STINNER Victor <[EMAIL PROTECTED]> added the comment:

The problem is not from Python but from your FPU during the conversion 
from 64 bits float to 32 float (made by struct.pack). Example in C:

#include <stdio.h>
int main()
{
    float f;
    double d;
    d = 1.8183;
    printf("d=%.20f\n", d);
    f = (float)d;
    d = (double)f;
    printf("f=%.20f\n", f);
    printf("d=%.20f\n", d);
    return 0;
}

Result:
d=1.81830000000000002736   # ok
f=1.81830000877380371094   # 64->32: loose precision
d=1.81830000877380371094   # 32->64: no change

----------
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4114>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to