diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-12-02 13:52:49 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-02 13:52:49 (GMT) |
| commit | 22f8e430f81b8b8966bff0efe65786515a132b7e (patch) | |
| tree | 43189cd58eb8625dae41c52e0ac062457a3f9f99 /Python/pythonrun.c | |
| parent | 9f0d6b71d677363f305c63cb5601c1410310435e (diff) | |
| download | cpython-22f8e430f81b8b8966bff0efe65786515a132b7e.zip cpython-22f8e430f81b8b8966bff0efe65786515a132b7e.tar.gz cpython-22f8e430f81b8b8966bff0efe65786515a132b7e.tar.bz2 | |
[3.12] gh-99880: document rounding mode for new-style formatting (GH-121481) (#126335)
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 7d7d56d8b1147a6b85e1c09d01b164df7c5c4942)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Diffstat (limited to 'Python/pythonrun.c')
0 files changed, 0 insertions, 0 deletions
