Chapter 20. Numbers and Enumerations
20.0. Introduction
Simple types are value types that are a subset of the built-in types in C#, although, in fact, the types are defined as part of the .NET Framework Class Library (.NET FCL). Simple types are made up of several numeric types and a bool
type. These numeric types consist of a decimal type (decimal
), nine integral types (byte, char, int, long, sbyte, short, uint, ulong, ushort
), and two floating-point types (float, double
). Table 20-1 lists the simple types and their fully qualified names in the .NET Framework.
Fully qualified name | Alias | Value range |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When dealing with floating point data types, precision can be can be more important than the range of the data values. The precision of the floating point data types is listed in Table 20-2.
| Precision |
|
|
Get C# 3.0 Cookbook, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.