what's the precision of fractions.Fraction?

Arnaud Delobelle arnodel at gmail.com
Sat Nov 20 04:17:15 EST 2010


Peter Pearson <ppearson at nowhere.invalid> writes:

> On Fri, 19 Nov 2010 07:29:59 -0800 (PST), RJB <rbotting at csusb.edu> wrote:
>> Does Fractions remove common factors the way it should?
>>
>> If it does and you want to find the closest fraction with a smaller
>> denominator i think tou'll need some number theory and continued
>> fractions.
>
> No heroics required, finding the greatest common divisor is fast.

I think RJB was referring to e.g. finding the closest fraction to a
certain fraction with a bounded denominator.

-- 
Arnaud




More information about the Python-list mailing list