floating-point-literal: decimal-floating-point-literal hexadecimal-floating-point-literal

decimal-floating-point-literal: fractional-constant exponent-part floating-point-suffix digit-sequence exponent-part floating-point-suffix

hexadecimal-floating-point-literal: hexadecimal-prefix hexadecimal-fractional-constant binary-exponent-part floating-point-suffix hexadecimal-prefix hexadecimal-digit-sequence binary-exponent-part floating-point-suffix

fractional-constant: digit-sequence . digit-sequence digit-sequence .

hexadecimal-fractional-constant: hexadecimal-digit-sequence . hexadecimal-digit-sequence hexadecimal-digit-sequence .

exponent-part: e sign digit-sequence E sign digit-sequence

binary-exponent-part: p sign digit-sequence P sign digit-sequence

sign: one of + -

digit-sequence: digit digit-sequence ' digit

floating-point-suffix: one of f l F L

The type of a floating-point-literal is determined by
its floating-point-suffix as specified in Table 10.

Table 10: Types of floating-point-literals [tab:lex.fcon.type]

floating-point-suffix | type |

none | |

f or F | |

l or L |

The *significand* of a floating-point-literal
is the fractional-constant or digit-sequence
of a decimal-floating-point-literal
or the hexadecimal-fractional-constant
or hexadecimal-digit-sequence
of a hexadecimal-floating-point-literal.

In the significand,
the sequence of digits or hexadecimal-digits
and optional period are interpreted as a base N real number s,
where N is 10 for a decimal-floating-point-literal and
16 for a hexadecimal-floating-point-literal.

If an exponent-part or binary-exponent-part
is present,
the exponent e of the floating-point-literal
is the result of interpreting
the sequence of an optional sign and the digits
as a base 10 integer.

Otherwise, the exponent e is 0.

The scaled value of the literal is
for a decimal-floating-point-literal and
for a hexadecimal-floating-point-literal.

[ Example

: — *end example*

]If the scaled value is not in the range of representable
values for its type, the program is ill-formed.

Otherwise, the value of a floating-point-literal
is the scaled value if representable,
else the larger or smaller representable value nearest the scaled value,
chosen in an implementation-defined manner.