]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44339: Fix math.pow corner case to comply with IEEE 754 (GH-26606)
authorMark Dickinson <mdickinson@enthought.com>
Sat, 12 Jun 2021 09:23:02 +0000 (10:23 +0100)
committerGitHub <noreply@github.com>
Sat, 12 Jun 2021 09:23:02 +0000 (10:23 +0100)
commit4a42cebf6dd769e2fa4e234a9e91093b3ad1cb63
tree925efc812b8810d8c5fb6c1040307d1cacf4b976
parent3ec3ee7d2e9b45b586e486e429b412d6d0ca530f
bpo-44339: Fix math.pow corner case to comply with IEEE 754 (GH-26606)

Change the behaviour of `math.pow(0.0, -math.inf)` and `math.pow(-0.0, -math.inf)` to return positive infinity instead of raising `ValueError`. This makes `math.pow` consistent with the built-in `pow` (and the `**` operator) for this particular special case, and brings the `math.pow` special-case handling into compliance with IEEE 754.
Doc/library/math.rst
Doc/whatsnew/3.11.rst
Lib/test/ieee754.txt
Lib/test/test_math.py
Misc/NEWS.d/next/Library/2021-06-08-17-47-38.bpo-44339.9JwMSc.rst [new file with mode: 0644]
Modules/mathmodule.c