Chapter 1. Numbers
Simple types
are value
types that are a subset of the built-in types in Visual C# .NET,
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 1-1 lists the
simple types and their fully qualified names in the .NET Framework.
Table 1-1. The simple data types
|
Fully qualified name |
Reserved C# keyword |
Value range |
|---|---|---|
|
|
|
|
|
|
|
0 to 255 |
|
|
|
-128 to 127 |
|
|
|
0 to 65535 |
|
|
|
-79,228,162,514,264,337,593,543,950,335 to 79,228,162,514,264,337,593,543,950,335 |
|
|
|
-1.79769313486232e308 to 1.79769313486232e308 |
|
|
|
-3.402823e38 to 3.402823e38 |
|
|
|
-32768 to 32767 |
|
|
|
0 to 65535 |
|
|
|
-2,147,483,648 to 2,147,483,647 |
|
|
|
0 to 4,294,967,295 |
|
|
|
-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
|
|
|
0 to 18,446,744,073,709,551,615 |
The C# reserved words for the various data types are simply aliases for the fully qualified type name. Therefore, it does not matter whether you ...