Mark Dickinson <[EMAIL PROTECTED]> added the comment: 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. Added file: http://bugs.python.org/file10897/hex_float9.patch _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3008> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com