Previous Table of Contents "New C Standard" commentary

floating-constant: decimal-floating-constant hexadecimal-floating-constant decimal-floating-constant: fractional-constant exponent-part

_{opt}floating-suffix_{opt}digit-sequence exponent-part floating-suffix_{opt}hexadecimal-floating-constant: hexadecimal-prefix hexadecimal-fractional-constant binary-exponent-part floating-suffix

_{opt}hexadecimal-prefix hexadecimal-digit-sequence binary-exponent-part floating-suffix_{opt}fractional-constant: digit-sequence

_{opt}. digit-sequence digit-sequence .

exponent-part: e sign _{opt}digit-sequenceE sign _{opt}digit-sequence

sign: one of+ -

digit-sequence: digit digit-sequence digit

hexadecimal-fractional-constant: hexadecimal-digit-sequence _{opt}. hexadecimal-digit-sequence hexadecimal-digit-sequence .

binary-exponent-part: p sign _{opt}digit-sequenceP sign _{opt}digit-sequence

hexadecimal-digit-sequence: hexadecimal-digit hexadecimal-digit-sequence hexadecimal-digit

floating-suffix: one off l F L

843
A floating constant has a *significand part* that may be
followed by an *exponent part* and a suffix that specifies its
type.

844
The components of the significand part may include a digit sequence
representing the whole-number part, followed by a period
(

845
The components of the exponent part are an

846 Either the whole-number part or the fraction part has to be present;

847 for decimal floating constants, either the period or the exponent part has to be present.

848 The significand part is interpreted as a (decimal or hexadecimal) rational number;

849 the digit sequence in the exponent part is interpreted as a decimal integer.

850 For decimal floating constants, the exponent indicates the power of 10 by which the significand part is to be scaled.

851 For hexadecimal floating constants, the exponent indicates the power of 2 by which the significand part is to be scaled.

852
For decimal floating constants, and also for hexadecimal floating
constants when

853
For hexadecimal floating constants when

854
An unsuffixed floating constant has type

855
If suffixed by the letter

856
If suffixed by the letter

857 Floating constants are converted to internal format as if at translation-time.

858 The conversion of a floating constant shall not raise an exceptional condition or a floating-point exception at execution time.

859 The implementation should produce a diagnostic message if a hexadecimal constant cannot be represented exactly in its evaluation format;

860 the implementation should then proceed with the translation of the program.

861
The translation-time conversion of floating constants should match
the execution-time conversion of character strings by library
functions, such as ^{64)}

862 64) The specification for the library functions recommends more accurate conversion than required for floating constants (see 7.20.1.3).

Created at: 2008-01-30 02:39:42 The text from WG14/N1256 is copyright © ISO