Robert Withrow added the comment:
I have to disagree. It seems entirely reasonable to expect that unpack should
return the same value passed to pack. That it doesn't (as of 2.6.5 at least)
is completely unexpected and undocumented. And yes I understand the
limitations of floating
Robert Withrow added the comment:
Martin: in C I have the luxury of using 32 bit floats; not an option in Python.
Simple code doing the moral equivalent of NTOHL(HTONL()) works in this case
for C but wouldn't help for Python.
Mark: I understand about the precision truncation issue an
Robert Withrow added the comment:
> If you agree that Python actually behaves correct, I fail to
> understand what it is that you disagree with in msg131195
I don't agree that Python is behaving correctly as far as the documented
contract for struct is concerned.
I disagr
Robert Withrow added the comment:
> it needs to be worded in a way that doesn't
> imply that the struct implementation is broken or misdesigned.
Agree.
> A better note would focus on the basic (and obvious)
> fact that downgrading from double precision to single
> precisi
Robert Withrow added the comment:
For completeness: msg131234 states that the issue of 64 bit -> 32 bit precision
truncation is covered in the floating point tutorial. I believe that is
incorrect; at least I can't find it explicitly mentioned. Ref:
http://docs.python.org/