C#: Using Suffixes to Declare Data Literals
Thursday, May 1st, 2008This isn’t new, but handy to have. In order to tell the compiler which data type we’re using, we use suffix notation as follows:
- Unsigned integer, U: e.g. 34506U
- Long integer (signed), L: e.g. 5297532L
- Unsigned long integer, UL: e.g. 30958UL
- Float, F: e.g. 13.6F
- Double, D: e.g. 14.3D
- Decimal, M: e.g. 19.95M