Skip to content

Commit 8d99ad8

Browse files
committed
Add comment for copysign and add functions to NEWS
1 parent f57140e commit 8d99ad8

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
The function :func:`math.copysign` no longer sets ``errno`` to zero.
1+
The following functions no longer set ``errno`` to zero: :func:`cmath.phase`,
2+
:func:`math.atan2`, :func:`math.atan2pi`, and :func:`math.copysign`.
23
Contributed by High Performance Kernels LLC.

‎Modules/mathmodule.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,8 @@ math_ceil(PyObject *module, PyObject *number)
12111211
return PyLong_FromDouble(ceil(x));
12121212
}
12131213

1214+
/* gh-153144: Ignore copysign errno on purpose since IEEE Std 754-2019 requires
1215+
* it to operate on bit strings and to signal no exception. */
12141216
FUNC2NE(copysign, copysign,
12151217
"copysign($module, x, y, /)\n--\n\n"
12161218
"Return a float with the magnitude (absolute value) of x but the sign of y.\n\n"

0 commit comments

Comments
 (0)