CSharp examples for Language Basics:Data Type
C# Data | NET Data | Size | Low | High |
---|---|---|---|---|
Type | Type | in Bytes | Value | Value |
sbyte | System.Sbyte | 1 | -128 | 127 |
byte | System.Byte | 1 | 0 | 255 |
short | System.Int16 | 2 | -32,768 | 32,767 |
ushort | System.UInt16 | 2 | 0 | 65,535 |
int | System.Int32 | 4 | -2,147,483,648 | 2,147,483,647 |
uint | System.UInt32 | 4 | 0 | 4,294,967,295 |
long | System.Int64 | 8 | -9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 |
ulong | System.UInt64 | 8 | 0 | 18,446,744,073,709,551,615 |
char | System.Char | 2 | 0 | 65,535 |
float | System.Single | 4 | 1.5x10 ^ -45 | 3.4x10 ^ 38 |
double | System.Double | 8 | 5.0x10 ^ -324 | 1.7x10 ^ 308 |
bool | System.Boolean | 1 | false (0) | true (1) |
decimal | System.Decimal | 16 | 1.0x10 ^ -28 | approx. 7.9x10 ^ 28 |