Suffixes specify number types. They instruct the C# compiler that an integral literal such as 1000 be considered a certain type of number—for example, a long (1000L). We look into how you can add numeric suffixes to numbers.

Example. First, numeric suffixes, which are also called literal number suffixes, are hints to the compiler that a literal number is of a certain type. Recall that "literal" means a value hard-coded into your program.

Note: Literal suffixes on constants actually generate conv instructions. This means they work the same as runtime casts.

The letters L, D, F, U, M and UL are appended to the end of the integral literals in the declarations in the Main entry point above. This instructs the C# compiler that 10000 is a long type, not an int type.

Note: The MSIL generated is similar to using casts such as (long)10000. We can see this in IL Disassembler.

Review. We describe the suffixes in more detail. This table indicates the meaning of the letters. We also see examples of the suffixes in the C# programming language. The code statements can be used within programs.

Summary. Suffixes can be used on literal numbers in C# programs. This is a way to tell the C# compiler that you want the literal number to be treated as a certain type of number, similar conceptually to a cast.

Note: The specification defines how numbers are converted when used as operands, but these suffixes can force certain conversions.