C# Professional - Numbers
Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Numeric types in C#
C# offers multiple numeric types, for integer data types and non-integer data types.
Integer Data Types
Type | Description | Minimum Value | Maximum Value |
---|---|---|---|
byte | Unsigned byte | 0 | 255 |
sbyte | Signed byte | -128 | 127 |
short | Signed byte | -32 768 | 32 767 |
ushort | Unsigned byte | 0 | 65 535 |
int | Signed byte | -2 147 483 648 | 2 147 483 647 |
uint | Unsigned byte | 0 | 4 294 967 295 |
long | Signed byte | -9x108 | 9x108 |
ulong | Unsigned byte | 0 | 1,8x1019 |
Non-integer Data Types
All non-integer data types are signed.
Type | Description | Scale | Precision |
---|---|---|---|
float | Single Precision Number | ±1.5x10-45 to ±3.4x1038 | 7 digits |
double | Double Precision Number | ±5x10-324 to ±1.7x10308 | 15 or 16 digits |
decimal | Decimal Number | ±10-28 to ±7.9x1028 | 28 or 29 digits |
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content