Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change as requested in review
  • Loading branch information
hpkfft committed Oct 3, 2026
commit 6a92490af2950cda0ab52641120222b9c1de947b
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
Given a complex number ``z`` for which ``z.imag/z.real`` underflows to zero,
the :func:`cmath.phase` of ``z`` should not raise ``OverflowError``. Also,
given arguments of zero, Python's :func:`math.atan2`, :func:`math.atan2pi`,
and :func:`cmath.phase` should return the values specified by Annex F of the
C standard, not raise ``ValueError``, regardless of whether the platform's
math library sets ``errno`` for ``atan2(0.0, 0.0)``, ``atan2(0.0, -0.0)``, etc.
Contributed by High Performance Kernels LLC.
The function :func:`cmath.phase` should not raise ``OverflowError``, and the
functions :func:`math.atan2`, :func:`math.atan2pi`, and :func:`cmath.phase`
should not raise ``ValueError``. Contributed by High Performance Kernels LLC.
Comment thread
hpkfft marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The function :func:`math.copysign` no longer sets ``errno`` to zero.
Contributed by High Performance Kernels LLC.
Comment thread
hpkfft marked this conversation as resolved.
6 changes: 4 additions & 2 deletions Modules/mathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,9 @@ math_2(PyObject *const *args, Py_ssize_t nargs,
double (*func) (double, double), const char *funcname)
{
double x, y, r;
if (!_PyArg_CheckPositional(funcname, nargs, 2, 2))
if (!_PyArg_CheckPositional(funcname, nargs, 2, 2)) {
Comment thread
skirpichev marked this conversation as resolved.
return NULL;
}
x = PyFloat_AsDouble(args[0]);
if (x == -1.0 && PyErr_Occurred()) {
return NULL;
Expand Down Expand Up @@ -1068,8 +1069,9 @@ math_2ne(PyObject *const *args, Py_ssize_t nargs,
double (*func) (double, double), const char *funcname)
{
double x, y, r;
if (!_PyArg_CheckPositional(funcname, nargs, 2, 2))
if (!_PyArg_CheckPositional(funcname, nargs, 2, 2)) {
return NULL;
Comment thread
picnixz marked this conversation as resolved.
}
x = PyFloat_AsDouble(args[0]);
if (x == -1.0 && PyErr_Occurred()) {
return NULL;
Expand Down
Loading