summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-12-02 19:47:42 (GMT)
committerGitHub <noreply@github.com>2024-12-02 19:47:42 (GMT)
commit8fffbb098259ed413d75dbc2e6d3e540425bd9b9 (patch)
treeebc6f0380203fee15667e74fcad3694538c80a91 /Python/pythonrun.c
parent34fe4af8a21366de329a3a69d7e87363060bccba (diff)
downloadcpython-8fffbb098259ed413d75dbc2e6d3e540425bd9b9.zip
cpython-8fffbb098259ed413d75dbc2e6d3e540425bd9b9.tar.gz
cpython-8fffbb098259ed413d75dbc2e6d3e540425bd9b9.tar.bz2
[3.12] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211) (GH-127216) (GH-127530)
[3.13] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211) (GH-127216) Note, that transformed expression is not an equivalent for original one (1/exp(-x) != exp(x) in general for floating-point numbers). Though, the difference seems to be ~1ULP for good libm implementations. It's more interesting why division was used from beginning. Closest algorithm I've found (no error checks, of course;)) - it's Algorithm 190 from ACM: https://dl.acm.org/doi/10.1145/366663.366679. It uses subtraction in the exponent. (cherry picked from commit f7bb658124aba74be4c13f498bf46cfded710ef9) (cherry picked from commit f41d8d89e79d634895868656f50a0e16e339f9d6) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Diffstat (limited to 'Python/pythonrun.c')
0 files changed, 0 insertions, 0 deletions