Reputation: 27561
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.
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/
Upvotes: 10
Views: 936
Reputation: 88786
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-suffix
es include:
U u - unsigned int
L l - long
UL Ul uL ul LU Lu lU lu - unsigned long
real-type-suffix
es include:
F f - float
D d - double
M m - decimal
Upvotes: 9
Reputation: 754525
I don't know if there is an official term but the C# language spec commonly refers to them as type suffixes.
Upvotes: 12
Reputation: 63435
Numeric Literal Suffix
A list:
uint: u
long: l
ulong: ul
float: f
decimal: m
Upvotes: 12