Message413441
>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. |
|
Date |
User |
Action |
Args |
2022-02-17 19:07:21 | Leengit | set | recipients:
+ Leengit, rhettinger, mark.dickinson, zach.ware, serhiy.storchaka |
2022-02-17 19:07:21 | Leengit | set | messageid: <1645124841.29.0.590286274359.issue46780@roundup.psfhosted.org> |
2022-02-17 19:07:21 | Leengit | link | issue46780 messages |
2022-02-17 19:07:21 | Leengit | create | |
|