[issue9829] Unexpected Fraction.from_float() Behavior

2010-09-11 Thread R. David Murray
R. David Murray added the comment: Please read about floating point arithmetic in the tutorial: http://docs.python.org/tutorial/floatingpoint.html Also observe that this works: >>> Fraction(Decimal('1.23')) Fraction(123, 100) So yes, it is a limitation in how floating point is rep

[issue9829] Unexpected Fraction.from_float() Behavior

2010-09-10 Thread bsidhom
New submission from bsidhom : The Fractions.from_float() call returns an incorrect value when run on certain numbers. Some test runs have been listed below. Note that this problem does not exist when the same float is converted to a string and then passed to the standard Fraction() constructor