This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients alexandre.vassalotti, amaury.forgeotdarc, belopolsky, gvanrossum, mark.dickinson, pitrou, rhettinger, terry.reedy
Date 2008-07-15.15:57:05
SpamBayes Score 1.6154447e-08
Marked as misclassified No
Message-id <1216137435.93.0.14439386817.issue3008@psf.upfronthosting.co.za>
In-reply-to
Content
Here's an updated patch that addresses Raymond's concerns.

> The patch looks good.  I would coded hex_from_char() using a lookup 
> into "0123456789abcdef" which uses no unpredicatable branches.  
> Likewise, I would done hex_from_char() with a case statement (limiting 
> the call to single unpredicatable branch).

Done.

> Question:  are the ("0x0p+0") and ("-0x0p+0") special cases standard?

Not entirely.  Java outputs "0x0.0p0" and "-0x0.0p0".  The C99 standard 
doesn't specify exactly how the output should look, except to say that 
the exponent should be 0.  The '+' is there for consistency.

I can change '0x0p+0' to '0x0.0p+0' if people think this looks prettier.
On consideration, this does look better to me.  Changed.

> The docs need a "new in py2.6"

Fixed.

> Coding style:  move the inner si++ to a separate line so there are no 
> side-effects and the order of execution is obvious.

Done.  (And the same with s++ in float_fromhex.)

> Question:  should the "inf" string checks be made case sensitive on 
> insensitive?  Is there a standard?

Everything I've seen, except Java, seems to like case-insensitivity.  
The C99 standard says case should be ignored, as does the IBM Decimal 
standard.  Python's float('nan') and float('inf') also currently ignore 
case.  So I think these checks should be case insensitive.

(Java insists on infinity being spelt "Infinity", and nan being spelt 
"NaN".)

Thank you for reviewing this, Raymond!

I aim to check this in when (if?) I get approval from Barry.
History
Date User Action Args
2008-07-15 15:57:16mark.dickinsonsetspambayes_score: 1.61544e-08 -> 1.6154447e-08
recipients: + mark.dickinson, gvanrossum, rhettinger, terry.reedy, amaury.forgeotdarc, belopolsky, pitrou, alexandre.vassalotti
2008-07-15 15:57:15mark.dickinsonsetspambayes_score: 1.61544e-08 -> 1.61544e-08
messageid: <1216137435.93.0.14439386817.issue3008@psf.upfronthosting.co.za>
2008-07-15 15:57:15mark.dickinsonlinkissue3008 messages
2008-07-15 15:57:13mark.dickinsoncreate