struct, IEEE-754 and internal representation

Robert Kern robert.kern at gmail.com
Wed Nov 9 18:15:44 EST 2005


ej wrote:

>     If that's true, then I guess I am confused why Python is displaying
> 148.72999572753906 when you unpack the 4 bytes, implying a lot more
> precision that was available in the original 32-bits?   Python is doing
> 64-bit floating point here? I'm obviously not understanding something...
> help?

Yes, Python uses C double precision floats for float objects.

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the Python-list mailing list