Wednesday, 7 December 2011

C#: System data types

C#
Shorthand
System Type
Range
Meaning in life
sbyteSystem.Sbyte -128 to 127Signed 8-bit number
byteSystem.byte 0 to 255Unsigned 8-bit
number
shortSystem.Int16 -32.768 to 32.767Signed 16-bit number
ushortSystem.UInt16 0 to 65.535Unsigned
16-bit number
intSystem.Int32 -2.147.483.648 to
2.147.483.647
Signed 32-bit
number
uintSystem.UInt32 0 to 4,294,967,295Unsigned
32-bit number
longSystem.Int64 –9,223,372,036,854,775,808
to
9,223,372,036,854,775,807
Signed 64-bit
number
ulongSystem.UInt64 0 to
18,446,744,073,709,551,615
Unsigned
64-bit number
charSystem.Char U0000 to UffffA single 16-bit
Unicode character
floatSystem.Single 1.5x10-45 to 3.4x103832-bit floating
point number
doubleSystem.Double 5.0x10-324 to 1.7x1030864-bit floating
point number
boolSystem.Boolean true or falseRepresents
truth or falsity
decimalSystem.Decimal 100 to 1028A 96-bit signed
number
stringSystem.String Limited by system memoryRepresents a
set of Unicode
characters
objectSystem.Object Any type can be stored
in an object variable
The base class of all
types in the .NET
universe

No comments:

Post a Comment