Mark Dickinson added the comment:

About .trim and .approximate:  

it sounds like these are different, but quite closely related, methods:  one 
takes a positive 
integer and returns the best approximation with denominator bounded by that 
integer;  the other 
returns the 'smallest' rational in a given interval centered at the original 
rational.  I guess 
we probably don't need both of these, but I can't give any good reason for 
preferring one over 
the other.

I don't have anything to offer about names, either.

I can try to find out whether the algorithms are published anywhere on the 
web---certainly, 
neither algorithm should be particularly hard to implement and prove the 
correctness of;  they 
both essentially rely on computing the continued fraction development of the 
given rational.  
Almost any not-too-basic elementary number theory text should contain proofs of 
the relevant 
results about continued fractions.

Am willing to help out with implementing either of these, if that's at all 
useful.

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1682>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to