Commit 23ab1f9
The CPython uses _Py_dg_dtoa(), which does rounding to nearest with half
to even tie-breaking rule.
If that functions is unavailable, PyOS_double_to_string() fallbacks to
system snprintf(). Since CPython 3.12, build requirements include C11
compiler *and* support for IEEE 754 floating point numbers (Annex F).
This means that FE_TONEAREST macro is available and, per default,
printf-like functions should use same rounding mode as _Py_dg_dtoa().
(cherry picked from commit 7d7d56d)
Co-authored-by: Sergey B Kirpichev <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
1 parent fd48d98 commit 23ab1f9
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
592 | 597 | | |
593 | 598 | | |
594 | 599 | | |
| |||
0 commit comments