Commit 90f8bf2
committed
gh-67795: Improve precision of non-float timestamp and timeout arguments
Use the as_integer_ratio() or the numerator and denominator attributes
to represent the number as an integer ratio and perform scaling and
rounding exactly.
This allows to avoid the precision loss and double rounding error due to
conversion to float.1 parent 1a2e00c commit 90f8bf2
File tree
10 files changed
+322
-23
lines changed- Doc/whatsnew
- Include/internal
- Lib
- test
- Misc/NEWS.d/next/Library
- Python
10 files changed
+322
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
| 285 | + | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
404 | 405 | | |
405 | 406 | | |
406 | 407 | | |
| |||
643 | 644 | | |
644 | 645 | | |
645 | 646 | | |
| 647 | + | |
646 | 648 | | |
647 | 649 | | |
648 | 650 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1857 | 1857 | | |
1858 | 1858 | | |
1859 | 1859 | | |
1860 | | - | |
1861 | | - | |
1862 | | - | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
1863 | 1877 | | |
1864 | | - | |
| 1878 | + | |
1865 | 1879 | | |
1866 | 1880 | | |
1867 | | - | |
| 1881 | + | |
1868 | 1882 | | |
1869 | 1883 | | |
1870 | 1884 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2773 | 2773 | | |
2774 | 2774 | | |
2775 | 2775 | | |
2776 | | - | |
| 2776 | + | |
2777 | 2777 | | |
2778 | 2778 | | |
2779 | 2779 | | |
2780 | | - | |
| 2780 | + | |
2781 | 2781 | | |
2782 | 2782 | | |
2783 | 2783 | | |
| |||
2790 | 2790 | | |
2791 | 2791 | | |
2792 | 2792 | | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
2793 | 2808 | | |
2794 | 2809 | | |
2795 | 2810 | | |
| |||
2824 | 2839 | | |
2825 | 2840 | | |
2826 | 2841 | | |
2827 | | - | |
| 2842 | + | |
| 2843 | + | |
2828 | 2844 | | |
2829 | 2845 | | |
2830 | 2846 | | |
2831 | | - | |
| 2847 | + | |
| 2848 | + | |
2832 | 2849 | | |
2833 | 2850 | | |
2834 | 2851 | | |
| |||
2841 | 2858 | | |
2842 | 2859 | | |
2843 | 2860 | | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
2844 | 2878 | | |
2845 | 2879 | | |
2846 | 2880 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
954 | | - | |
955 | | - | |
956 | | - | |
| 954 | + | |
957 | 955 | | |
958 | 956 | | |
959 | 957 | | |
960 | 958 | | |
961 | | - | |
962 | | - | |
963 | | - | |
| 959 | + | |
964 | 960 | | |
965 | 961 | | |
966 | 962 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
0 commit comments