Skip to content

Instantly share code, notes, and snippets.

@nasser
Created November 2, 2018 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nasser/f41e5ef5732660fd2d9540e7747d7e91 to your computer and use it in GitHub Desktop.
Save nasser/f41e5ef5732660fd2d9540e7747d7e91 to your computer and use it in GitHub Desktop.
Primitive Type Names on the CLR

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.* and conv.*
  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment