Lee Newberg <git...@quantconsulting.com> added the comment:

>It would return 1/7 for "0.1" and 1/4 for "0.2". Is it what you expected?

I answered "yes" before, but I am now thinking "no".  In the case of "0.1", the 
smallest numerator achievable is 1, but there are multiple denominators that 
would give a value within [0.05, 0.15).  So, I'd choose the denominator that 
gives the ratio that is closet to the input value.

This is similar to the "16e2" example but with the roles of numerator and 
denominator reversed.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46780>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to