mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue 2801: fix bug in float.is_integer where ValueError was incorrectly
raised.
This commit is contained in:
parent
b27406c03e
commit
c4352b061a
2 changed files with 4 additions and 0 deletions
|
@ -900,6 +900,7 @@ float_is_integer(PyObject *v)
|
|||
return NULL;
|
||||
if (!Py_IS_FINITE(x))
|
||||
Py_RETURN_FALSE;
|
||||
errno = 0;
|
||||
PyFPE_START_PROTECT("is_integer", return NULL)
|
||||
o = (floor(x) == x) ? Py_True : Py_False;
|
||||
PyFPE_END_PROTECT(x)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue