mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Use correct capitalization of NaN
This commit is contained in:
parent
1ae415cbee
commit
bd7c4ca569
1 changed files with 2 additions and 2 deletions
|
@ -1548,7 +1548,7 @@ float_as_integer_ratio(PyObject *v, PyObject *unused)
|
||||||
#ifdef Py_NAN
|
#ifdef Py_NAN
|
||||||
if (Py_IS_NAN(self)) {
|
if (Py_IS_NAN(self)) {
|
||||||
PyErr_SetString(PyExc_ValueError,
|
PyErr_SetString(PyExc_ValueError,
|
||||||
"Cannot pass nan to float.as_integer_ratio.");
|
"Cannot pass NaN to float.as_integer_ratio.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1607,7 +1607,7 @@ PyDoc_STRVAR(float_as_integer_ratio_doc,
|
||||||
"\n"
|
"\n"
|
||||||
"Returns a pair of integers, whose ratio is exactly equal to the original\n"
|
"Returns a pair of integers, whose ratio is exactly equal to the original\n"
|
||||||
"float and with a positive denominator.\n"
|
"float and with a positive denominator.\n"
|
||||||
"Raises OverflowError on infinities and a ValueError on nans.\n"
|
"Raises OverflowError on infinities and a ValueError on NaNs.\n"
|
||||||
"\n"
|
"\n"
|
||||||
">>> (10.0).as_integer_ratio()\n"
|
">>> (10.0).as_integer_ratio()\n"
|
||||||
"(10, 1)\n"
|
"(10, 1)\n"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue