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

A floating-point literal consists of
an optional prefix specifying a base,
an integer part,
a radix point,
a fraction part,
an e, E, p or P,
an optionally signed integer exponent, and
an optional type suffix.

The integer and fraction parts both consist of
a sequence of decimal (base ten) digits if there is no prefix, or
hexadecimal (base sixteen) digits if the prefix is 0x or 0X.

The floating-point literal is a *decimal floating-point literal* in the former case and
a *hexadecimal floating literal* in the latter case.

Optional separating single quotes in
a digit-sequence or hexadecimal-digit-sequence
are ignored when determining its value.

[ Example

: — *end example*

]
Either the integer part or the fraction part (not both) can be omitted.

Either the radix point or the letter e or E and
the exponent (not both) can be omitted from a decimal floating-point literal.

The radix point (but not the exponent) can be omitted
from a hexadecimal floating-point literal.

The integer part, the optional radix point, and the optional fraction part,
form the *significand* of the floating-point literal.

In a decimal floating-point literal, the exponent, if present,
indicates the power of 10 by which the significand is to be scaled.

In a hexadecimal floating-point literal, the exponent
indicates the power of 2 by which the significand is to be scaled.

If the scaled value is in
the range of representable values for its type, the result is the scaled
value if representable, else the larger or smaller representable value
nearest the scaled value, chosen in an implementation-defined manner.

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