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:
F
or f
is of type float
. For example, the literals 1f
, 1.5f
, 1e10f
, and -123.456F
are all of type float
.D
or d
is of type double
. For example, the literals 1d
, 1.5d
, 1e10d
, and -123.456D
are all of type double
.M
or m
is of type decimal
. For example, the literals 1m
, 1.5m
, 1e10m
, and -123.456M
are all of type decimal
.If the specified literal cannot be represented in the indicated type, then a compile-time error occurs.