[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some nits on clause 6.12, Conversions (5.12 in recent drafts)



More on hex character sequence specification.  I have not read the C99
spec, but according to Harbison&Steele 5th edition, it is the exponent
that is mandatory; the radix point is optional.  The compilers I tried
(AIX xlc, and gcc) agree, for compile-time constants.  For run-time
input (atof, scanf) there is more leeway, as the syntax does not have
to determine the type (integer or floating-point), and in fact neither
radix point nor exponent are required; the hex integer is simply taken
at face value and converted to floating-point.

Btw, everybody does require the hexIndicator (0x prefix), unlike some
early proposals in 754R (now fixed).

So I think we do have a problem: either our grammar is wrong, or we
should not say that we follow C99.

Michel.
Sent: 2007-08-28 20:22:35 UTC

754 | revision | FAQ | references | list archive