views:

300

answers:

4

I feel like I should know the answer to this, but I don't.

What is the type character on a numeric literal called?

double myDouble = 12d;
float myFloat = 10f;

I wanted to find a complete list of them today, but couldn't come up with what to ask Google to search for.

EDIT

Found a decent list if anyone is interested

http://www.undermyhat.org/blog/2009/08/secrets-and-lies-of-type-suffixes-in-c-and-vb-net/

+15  A: 

It's called a data type suffix.

David M
+11  A: 

Numeric Literal Suffix

A list:

  • uint: u
  • long: l
  • ulong: ul
  • float: f
  • decimal: m
John Rasch
+9  A: 

I don't know if there is an official term but the C# language spec commonly refers to them as type suffixes.

JaredPar
Found exactly what I was looking for with 'c# type-suffix'. Thanks to everyone who responded.
Matthew Vines
Doesn't the fact that the C# spec refers to them a such *make* it an official term?
Joren
@Joren essentially yes. What I meant by that statement is that there is not a line I know of which explicitly states "these are called type-suffix's". It's just the common suffix used in the grammar
JaredPar
+7  A: 

The C# 3.0 specification (MSWord file) refers to them as type-suffix, divided into two categories: integer-type-suffix and real-type-suffix.

integer-type-suffixes include:
U u - unsigned int
L l - long
UL Ul uL ul LU Lu lU lu - unsigned long

real-type-suffixes include:
F f - float
D d - double
M m - decimal

R. Bemrose