Message131276
The suggested examples are misleading because they use 6.24 which is not exactly representable in binary floating point. Representation issues are orthogonal to the OP's issue which is really just a simple rounding example:
>>> x = float.fromhex('0x0.1234560000001')
>>> unpack('!f', pack('!f', x))[0].hex()
'0x1.2345600000000p-4'
Also, if something like the suggested note is adopted, it needs to be worded in a way that doesn't imply that the struct implementation is broken or misdesigned.
A better note would focus on the basic (and obvious) fact that downgrading from double precision to single precision
entails a loss of precision. |
|
Date |
User |
Action |
Args |
2011-03-17 18:21:48 | rhettinger | set | recipients:
+ rhettinger, loewis, mark.dickinson, vstinner, TD22057, Robert.Withrow |
2011-03-17 18:21:48 | rhettinger | set | messageid: <1300386108.07.0.565990668245.issue4114@psf.upfronthosting.co.za> |
2011-03-17 18:21:47 | rhettinger | link | issue4114 messages |
2011-03-17 18:21:47 | rhettinger | create | |
|