Hi,
The definition of floating literal in the C++ (ISO/IEC 14882:2003)
grammar is as follows (Note: I have replaced the "opt" subscript used
in the standard with [ ] to indicate optional symbol).
------BEGIN------
floating-literal:
fractional-constant [exponent-part] [floating-suffix]
digit-sequence exponent-part [floating-suffix]
fractional-constant:
[digit-sequence] . digit-sequence
digit-sequence .
exponent-part:
e signopt digit-sequence
E signopt digit-sequence
sign: one of
+ -
digit-sequence:
digit
digit-sequence digit
floating-suffix: one of
f l F L
------END------
The above specification does not allow for an optional sign (+ or -)
to be specified for the fractional-constant (for eg. -2.1e+2). Is this
a defect in the standard or am I missing something?
Thanks,
Murali