[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Some nits on clause 6.12, Conversions (5.12 in recent drafts)
- To: stds-754 <stds-754@xxxxxxxxxxxxxxxxx>
- Subject: Some nits on clause 6.12, Conversions (5.12 in recent drafts)
- From: Michel Hack (1-914-784-7648) <hack@xxxxxxxxxxxxxx>
- Date: Tuesday 28 Aug 2007 at 2:58 p.m. EDT (2007-08-28 18:58 GMT)
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