Primitive types on the Common Language Runtime have different names depending on who you ask
- CIL names used in Common Intermediate Language bytecode instructions like
ldc.*
andconv.*
- CTS names used in the Common Type System that underlies languages running on the CLR
- .NET names used in the .NET framework. These are the names of the classes that correspond to the primitive types, and will show up in stack traces and reflection.
- C# names used in C# syntax
- F# names used in F# syntax
CIL | CTS | .NET | C# | F# |
---|---|---|---|---|
u1 |
uint8 |
System.Byte |
byte |
byte |
i1 |
int8 |
System.SByte |
sbyte |
sbyte |
i2 |
int16 |
System.Int16 |
short |
int16 |
i4 |
int32 |
System.Int32 |
int |
int |
i8 |
int64 |
System.Int64 |
long |
int64 |
u2 |
uint16 |
System.UInt16 |
ushort |
uint16 |
u4 |
uint32 |
System.UInt32 |
uint |
uint32 |
u8 |
uint64 |
System.UInt64 |
ulong |
uint64 |
r4 |
float32 |
System.Single |
float |
float32 , single |
r8 |
float64 |
System.Double |
double |
float , double |
bool |
System.Boolean |
bool |
bool |
|
char |
System.Char |
char |
char |
|
System.Decimal |
decimal |
decimal |
||
i |
native int |
System.IntPtr |
unativeint |
|
u |
native uint |
System.UIntPtr |
unativeint |
|
object |
System.Object |
object |
obj |
|
string |
System.String |
string |
string |