[issue7028] hex function should work with floats

Mark Dickinson report at bugs.python.org
Thu Oct 1 09:33:07 CEST 2009


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

I agree it would be useful.  That's why this facility already exists in 
Python >= 2.6 (including Python 3.x).  :-)

Python 2.6.2 (r262:71600, Jul  8 2009, 09:56:31) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from math import pi
>>> pi.hex()
'0x1.921fb54442d18p+1'
>>> float.fromhex(_)
3.1415926535897931

----------
nosy: +mark.dickinson
resolution:  -> out of date
status: open -> pending

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


More information about the Python-bugs-list mailing list