A floating point constant consists of an integer part, a decimal point,
a fraction part, and an exponent part; where an exponent part is an
e
or E
, and an optionally signed integer
exponent. The integer and fraction parts both consist of a sequence of
digits. Either the integer part or the fraction part (not both) may be
missing; either the decimal point or the e
(E
)
and the exponent (not both) may be missing.
Note that a floating point constant may not contain any embedded blanks or special characters.
Some floating point constants are:
1.23 .23 0.23 1. 1.0 1.2e10 1.23e-15
but not
1,000.00 | comma not allowed |
1 000.00 | embedded space not allowed |
1000 | decimal point or exponential part needed |
.e0 | integer part or fractional part needed |
-3.14159 | this is a floating point expression, not a constant |