ECMA-334 C# Language Specification

9.4.4.3: Real literals

Real literals are used to write values of types float , double , and decimal .

real-literal
decimal-digits . decimal-digits exponent-partopt real-type-suffixopt
. decimal-digits exponent-partopt real-type-suffixopt
decimal-digits exponent-part real-type-suffixopt
decimal-digits real-type-suffix
exponent-part
e signopt decimal-digits
E signopt decimal-digits
+ -
real-type-suffix
F f D d M m

If no real-type-suffix is specified, the type of the real literal is double . Otherwise, the real-type-suffix determines the type of the real literal, as follows:

If the specified literal cannot be represented in the indicated type, a compile-time error occurs.

The value of a real literal having type float or double is determined by using the IEEE "round to nearest" mode.