Re: struct, IEEE-754 and internal representation

2005-11-09 Thread ej
Ah! Well! That explains it. I started to suspect that but (obviously) did not know that. LOL Thanks for your prompt reply, Grant. :) -ej -- http://mail.python.org/mailman/listinfo/python-list

Re: struct, IEEE-754 and internal representation

2005-11-09 Thread jepler
Use 'd' as the format character for 64-bit double precision numbers with struct. >>> x = 148.73 >>> unpack(">> unpack(" pgpB2b9owxZs7.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: struct, IEEE-754 and internal representation

2005-11-09 Thread Robert Kern
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 somethin

Re: struct, IEEE-754 and internal representation

2005-11-09 Thread Grant Edwards
On 2005-11-09, 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? Yes. C-Python "float"