Message74695
I'm receiving a 32 bit floating point number encoded in binary format.
The correct value for that number is 1.8183e-7 which can be expressed in
single precision just fine. Given that the number in the binary
encoding is 1.8183e-7, I expected to get that back, not
1.818300034983622e-07 (which is NOT the closest double precision number
to the actual single precision number).
After doing some experiments, I think the problem is a basic fact of
life in C code which is that casting that single precision value to a
double precision one does not specify what happens in the extra digits.
So I'm getting garbage in the extra digits when the struct module C
code casts the single to a double. The problem is that C doesn't assume
that the non-precise digits are zero.
Since this is a function of the underlying C language, I'll withdraw the
bug. (Hmm - I don't seem to have permission to do that) |
|
Date |
User |
Action |
Args |
2008-10-13 21:13:33 | TD22057 | set | recipients:
+ TD22057, vstinner |
2008-10-13 21:13:33 | TD22057 | set | messageid: <1223932413.67.0.988624435556.issue4114@psf.upfronthosting.co.za> |
2008-10-13 21:13:32 | TD22057 | link | issue4114 messages |
2008-10-13 21:13:31 | TD22057 | create | |
|