This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Leengit
Recipients Leengit, mark.dickinson, rhettinger, serhiy.storchaka, zach.ware
Date 2022-02-17.19:03:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645124612.06.0.240840687352.issue46780@roundup.psfhosted.org>
In-reply-to
Content
The example of "16e2" would yield the interval [1550, 1650).  The smallest denominator possible is 1.  The smallest numerator that works with that denominator is 1550, but I don't like 1550/1 as the answer.

To cover these edge cases, I'd modify the optimization to be that we continue to seek the smallest denominator, but in the case that multiple numerators would give ratios within the computed interval then we choose the numerator among these that gives the ratio closest to the input value.
History
Date User Action Args
2022-02-17 19:03:32Leengitsetrecipients: + Leengit, rhettinger, mark.dickinson, zach.ware, serhiy.storchaka
2022-02-17 19:03:32Leengitsetmessageid: <1645124612.06.0.240840687352.issue46780@roundup.psfhosted.org>
2022-02-17 19:03:32Leengitlinkissue46780 messages
2022-02-17 19:03:32Leengitcreate