Python math is off by .000000000000045

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sat Feb 25 17:51:33 EST 2012


On Sat, 25 Feb 2012 13:25:37 -0800, jmfauth wrote:

>>>> (2.0).hex()
> '0x1.0000000000000p+1'
>>>> (4.0).hex()
> '0x1.0000000000000p+2'
>>>> (1.5).hex()
> '0x1.8000000000000p+0'
>>>> (1.1).hex()
> '0x1.199999999999ap+0'
>>>>
>>>>
> jmf

What's your point? I'm afraid my crystal ball is out of order and I have 
no idea whether you have a question or are just demonstrating your 
mastery of copy and paste from the Python interactive interpreter.



-- 
Steven



More information about the Python-list mailing list