c/language/floating constant

Allows values of floating type to be used directly in expressions.

Syntax
A floating constant is a expression having the form:

Where the has the form

The has the form

@1@ The exponent syntax for a decimal floating-point constant @2@ The exponent syntax for hexadecimal floating-point constant

Explanation
For a decimal floating constant, the is interpreted as a decimal rational number, and the  of the exponent is interpreted as the integer power of 10 to which the significand has to be scaled.

Suffixes
An unsuffixed floating constant has type. If is the letter  or, the floating constant has type. If is the letter  or, the floating constant has type.

Optional parts
If the exponent is present and fractional part is not used, the decimal separator may be omitted:

For decimal floating constants, the part is optional. If it is omitted, the period is not optional, and either the or the  must be present.

Representable values
The result of evaluating a floating constant is either the nearest representable value or the larger or smaller representable value immediately adjacent to the nearest representable value, chosen in an implementation-defined manner (in other words, default rounding direction during translation is implementation-defined).

All floating constants of the same source form convert to the same internal format with the same value. Floating constants of different source forms, e.g. and, need not to convert to the same internal format and value.