[issue3008] Let bin/oct/hex show floats

Mark Dickinson report at bugs.python.org
Sat Jul 12 09:53:47 CEST 2008


Mark Dickinson <dickinsm at gmail.com> added the comment:

In the spirit of being "liberal in what you accept, but strict in what you 
emit", here's a version that makes both the leading '0x' and the trailing 
'p...' exponent optional on input.  Both of these are still produced on 
output.

Note that this version is still perfectly interoperable with C99 and Java 
1.5+:  fromhex accepts anything produced by C and Java (e.g. via C's '%a', 
or Java's toHexString), and the output of hex can be read by C99's 
strtod/sscanf and Java's Double constructor, and/or used as hex literals 
in C or Java source.

Added file: http://bugs.python.org/file10882/hex_float7.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3008>
_______________________________________


More information about the Python-bugs-list mailing list