STINNER Victor <[EMAIL PROTECTED]> added the comment: "Since 32 bit floats only have ~7 digits of precision, I expected to get the same thing back. Not 7 digits + garbage."
This problem is a well known problem of conversion from base 2 (IEEE float) to base 10 (Python unicode string). Search for any programming FAQ, eg. http://www.python.org/doc/faq/general/#why-are-floating-point-calculations-so-inaccurate "Python is just reflecting what C is doing": the problem is deeper in the silicium. If you want a better precision, use an arbitrary precision float type like decimal.Decimal() or the GMP library (Python: gmpy) _______________________________________ 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