[issue9829] Unexpected Fraction.from_float() Behavior

R. David Murray report at bugs.python.org
Sat Sep 11 16:00:04 CEST 2010

R. David Murray <rdmurray at bitdance.com> added the comment:

Please read about floating point arithmetic in the tutorial:


Also observe that this works:

    >>> Fraction(Decimal('1.23'))
    Fraction(123, 100)

So yes, it is a limitation in how floating point is represented...in all languages and platforms that use binary floating point.

nosy: +r.david.murray
resolution:  -> invalid
status: open -> closed

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list