Skip to content

Commit 25ec8e2

Browse files
committed
Add comments as requested in review
1 parent 91257f2 commit 25ec8e2

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Modules/cmathmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,7 @@ cmath_phase_impl(PyObject *module, Py_complex z)
10051005
double phi;
10061006

10071007
phi = atan2(z.imag, z.real); /* should not cause any exception */
1008+
/* gh-153144: Ignore atan2() errno on purpose. */
10081009
return PyFloat_FromDouble(phi);
10091010
}
10101011

Modules/mathmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ math_2ne(PyObject *const *args, Py_ssize_t nargs,
10781078
if (y == -1.0 && PyErr_Occurred()) {
10791079
return NULL;
10801080
}
1081-
r = (*func)(x, y);
1081+
r = (*func)(x, y); // Ignore errno on purpose.
10821082
return PyFloat_FromDouble(r);
10831083
}
10841084

@@ -1149,11 +1149,11 @@ FUNC1(atan, atan, 0,
11491149
"atan($module, x, /)\n--\n\n"
11501150
"Return the arc tangent (measured in radians) of x.\n\n"
11511151
"The result is between -pi/2 and pi/2.")
1152-
FUNC2NE(atan2, atan2,
1152+
FUNC2NE(atan2, atan2, // gh-153144: Ignore atan2() errno on purpose.
11531153
"atan2($module, y, x, /)\n--\n\n"
11541154
"Return the arc tangent (measured in radians) of y/x.\n\n"
11551155
"Unlike atan(y/x), the signs of both x and y are considered.")
1156-
FUNC2NE(atan2pi, m_atan2pi,
1156+
FUNC2NE(atan2pi, m_atan2pi, // gh-153144: Ignore atan2pi() errno on purpose.
11571157
"atan2pi($module, y, x, /)\n--\n\n"
11581158
"Return the arc tangent (measured in half-turns) of y/x.\n\n"
11591159
"Unlike atanpi(y/x), the signs of both x and y are considered.")

0 commit comments

Comments
 (0)