Table B.1. Simple types.
Size in bits | Value range | Standard | |
---|---|---|---|
| 8 |
| |
| 8 | 0 to 255, inclusive | |
| 8 | –128 to 127, inclusive | |
| 16 |
| Unicode |
| 16 | –32768 to 32767, inclusive | |
| 16 | 0 to 65535, inclusive | |
| 32 | –2,147,483,648 to 2,147,483,647, inclusive | |
| 32 | 0 to 4,294,967,295, inclusive | |
| 32 | Approximate negative range: –3.4028234663852886E+38 to –1.40129846432481707E–45 Approximate positive range: 1.40129846432481707E–45 to 3.4028234663852886E+38 Other supported values: positive and negative zero positive and negative infinity not-a-number (NaN) | IEEE 754 IEC 60559 |
| 64 | –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, inclusive | |
| 64 | 0 to 18,446,744,073,709,551,615, inclusive | |
64 | Approximate negative range: –1.7976931348623157E+308 to –4.94065645841246544E–324 Approximate positive range: 4.94065645841246544E–324 to 1.7976931348623157E+308 Other supported values: positive and negative zero positive and negative infinity not-a-number (NaN) | IEEE 754 IEC 60559 | |
| 128 | Negative range: –79,228,162,514,264,337,593,543,950,335 (–7.9E+28) to –1.0E–28 Positive range: 1.0E–28 to 79,228,162,514,264,337,593,543,950,335 (7.9E+28) |
This appendix is based on information from Sections 4.1.4–4.1.8 of Microsoft’s version of the C# Language Specification and Sections 11.1.4–11.1.8 of the ECMA-334 (the ECMA version of the C# Language Specification). These documents are available from the following websites:
msdn.microsoft.com/en-us/vcsharp/aa336809.aspx www.ecma-international.org/publications/standards/Ecma-334.htm |
Values of type float
have seven digits of precision.
Values of type double
have 15–16 digits of precision.
Values of type decimal
are represented as integer values that are scaled by a power of 10. Values between −1.0 and 1.0 are represented exactly to 28 digits.
For more information on IEEE 754 visit grouper.ieee.org/groups/754/
. For more information on Unicode, see Appendix F.