Message131195
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 point numbers.
I suggest that struct should be fixed so that struct.unpack(fmt,struct.pack(fmt,v)) == v and format is something like '!f'.
This can be done in C code (I do it) for IEEE 754 floats.
At the very list this unexpected behavior should be documented in struct. |
|
Date |
User |
Action |
Args |
2011-03-16 23:25:16 | Robert.Withrow | set | recipients:
+ Robert.Withrow, loewis, vstinner, TD22057 |
2011-03-16 23:25:16 | Robert.Withrow | set | messageid: <1300317916.65.0.123857807563.issue4114@psf.upfronthosting.co.za> |
2011-03-16 23:25:16 | Robert.Withrow | link | issue4114 messages |
2011-03-16 23:25:16 | Robert.Withrow | create | |
|