summaryrefslogtreecommitdiffstats
path: root/Lib/fractions.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #7379: Fix incorrect doctest for Fraction.limit_denominator.Mark Dickinson2009-11-231-2/+2
|
* Issue #6431: Fix Fraction comparisons with unknown types, and withMark Dickinson2009-07-181-30/+32
| | | | float infinities and nans. Backport of r74078 from py3k.
* Issue #5812: The two-argument form of the Fraction constructorMark Dickinson2009-04-241-12/+21
| | | | now accepts arbitrary Rational instances.
* Issue #5812: make Fraction('1e-6') valid. Backport of r71806.Mark Dickinson2009-04-221-19/+26
|
* Manually merge r68095,68186,68187,68188,68190 from 2.6 branch.Georg Brandl2009-01-031-1/+1
|
* Issue 3285: Fractions from_float() and from_decimal() accept Integral arguments.Raymond Hettinger2008-07-101-2/+6
|
* Use operator.index() instead of n.__index__().Raymond Hettinger2008-07-101-5/+2
|
* Issue 3287: Raise correct exception for float inputs.Raymond Hettinger2008-07-101-3/+5
|
* Remove trailing 'L's from numerator and denominator in theMark Dickinson2008-06-271-1/+1
| | | | repr() of a Fraction instance.
* Use repr() for bad input strings; this makes the empty string or binary ↵Andrew M. Kuchling2008-06-211-1/+1
| | | | characters more visible
* The __all__ variable forgot to expose the gcd() function.Raymond Hettinger2008-05-081-1/+1
|
* Change simple instances (in Fraction) of self.numerator and self.denominator toJeffrey Yasskin2008-02-141-28/+28
| | | | | | self._numerator and self._denominator. This speeds abs() up from 12.2us to 10.8us and trunc() from 2.07us to 1.11us. This doesn't change _add and friends because they're more complicated.
* Performance optimizations on Fraction's constructor.Jeffrey Yasskin2008-02-141-11/+9
| | | | | | | | | | | ./python.exe -m timeit -s 'from fractions import Fraction' 'Fraction(3)` 31.7 usec/loop -> 9.2 usec/loop ./python.exe -m timeit -s 'from fractions import Fraction' 'Fraction(3, 2)'` 27.7 usec/loop -> 9.32 usec/loop ./python.exe -m timeit -s 'from fractions import Fraction; f = Fraction(3, 2)' 'Fraction(f)' 31.9 usec/loop -> 14.3 usec/loop
* Revert change in r60712: turn alternate constructors back intoMark Dickinson2008-02-121-13/+13
| | | | classmethods instead of staticmethods.
* Implementation of Fraction.limit_denominator.Mark Dickinson2008-02-121-34/+52
| | | | | Remove Fraction.to_continued_fraction and Fraction.from_continued_fraction
* Put an extra space into the repr of a Fraction:Mark Dickinson2008-02-111-1/+1
| | | | Fraction(1, 2) instead of Fraction(1,2).
* Rename rational.Rational to fractions.Fraction, to avoid name clashMark Dickinson2008-02-101-0/+520
with numbers.Rational. See issue #1682 for related discussion.