mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +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
|
@ -12,6 +12,9 @@ What's new in Python 3.0b1?
|
|||
Core and Builtins
|
||||
-----------------
|
||||
|
||||
- Issue 2801: fix bug in the float.is_integer method where a ValueError
|
||||
was sometimes incorrectly raised.
|
||||
|
||||
Extension Modules
|
||||
-----------------
|
||||
|
||||
|
|
|
@ -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