Skip to content

Commit 226f544

Browse files
committed
Improve docstrings for isnan, isinf and isfinite.
1 parent 25fcd39 commit 226f544

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Modules/mathmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,7 @@ math_isfinite(PyObject *self, PyObject *arg)
18281828

18291829
PyDoc_STRVAR(math_isfinite_doc,
18301830
"isfinite(x) -> bool\n\n\
1831-
Check if float x is finite (not an infinity or NaN).");
1831+
Return True if x is neither an infinity nor a NaN, and False otherwise.");
18321832

18331833
static PyObject *
18341834
math_isnan(PyObject *self, PyObject *arg)
@@ -1841,7 +1841,7 @@ math_isnan(PyObject *self, PyObject *arg)
18411841

18421842
PyDoc_STRVAR(math_isnan_doc,
18431843
"isnan(x) -> bool\n\n\
1844-
Check if float x is not a number (NaN).");
1844+
Return True if x is a NaN (not a number), and False otherwise.");
18451845

18461846
static PyObject *
18471847
math_isinf(PyObject *self, PyObject *arg)
@@ -1854,7 +1854,7 @@ math_isinf(PyObject *self, PyObject *arg)
18541854

18551855
PyDoc_STRVAR(math_isinf_doc,
18561856
"isinf(x) -> bool\n\n\
1857-
Check if float x is infinite (positive or negative).");
1857+
Return True if x is a positive or negative infinity, and False otherwise.");
18581858

18591859
static PyMethodDef math_methods[] = {
18601860
{"acos", math_acos, METH_O, math_acos_doc},

0 commit comments

Comments
 (0)