Appendix L. Simple Types

Figure L.1. Simple types.

Type

Size in bits

Value range

Standard

bool

8

true or false

 

byte

8

0 to 255, inclusive

 

sbyte

8

128 to 127, inclusive

 

char

16

'u0000' to 'uFFFF' (0 to 65535), inclusive

Unicode

short

16

32768 to 32767, inclusive

 

ushort

16

0 to 65535, inclusive

 

int

32

2,147,483,648 to 2,147,483,647, inclusive

 

uint

32

0 to 4,294,967,295, inclusive

 

float

32

Approximate negative range:

IEEE 754

   

3.4028234663852886E+38 to

IEC 60559

   

1.40129846432481707E45

 
   

Approximate positive range:

 
   

1.40129846432481707E45 to

 
   

3.4028234663852886E+38

 
   

Other supported values:

 
   

positive and negative zero

 
   

positive and negative infinity

 
   

not-a-number (NaN)

 

long

64

9,223,372,036,854,775,808 to

 
   

9,223,372,036,854,775,807, inclusive

 

ulong

64

0 to 18,446,744,073,709,551,615, inclusive

 

double

64

Approximate negative range:

IEEE 754

   

1.7976931348623157E+308 to

IEC 60559

   

4.94065645841246544E324

 
   

Approximate positive range:

 
   

4.94065645841246544E324 to

 
   

1.7976931348623157E+308

 
   

Other supported values:

 
   

positive and negative zero

 
   

positive and negative infinity

 
   

not-a-number (NaN)

 

decimal

128

Negative range:

   

79,228,162,514,264,337,593,543,950,335

 
   

(7.9E+28) to 1.0E28

 
   

Positive range:

 
   

1.0E28 to

 
   

79,228,162,514,264,337,593,543,950,335

 
   

(7.9E+28)

 

Категории