mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Merged revisions 86293 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86293 | mark.dickinson | 2010-11-07 12:48:18 +0000 (Sun, 07 Nov 2010) | 1 line Issue #10145: the float.is_integer method was undocumented. ........
This commit is contained in:
parent
339293a372
commit
bee54f53b1
1 changed files with 14 additions and 4 deletions
|
@ -471,6 +471,16 @@ The float type has some additional methods.
|
||||||
:exc:`OverflowError` on infinities and a :exc:`ValueError` on
|
:exc:`OverflowError` on infinities and a :exc:`ValueError` on
|
||||||
NaNs.
|
NaNs.
|
||||||
|
|
||||||
|
.. method:: float.is_integer()
|
||||||
|
|
||||||
|
Return ``True`` if the float instance is finite with integral
|
||||||
|
value, and ``False`` otherwise::
|
||||||
|
|
||||||
|
>>> (-2.0).is_integer()
|
||||||
|
True
|
||||||
|
>>> (3.2).is_integer()
|
||||||
|
False
|
||||||
|
|
||||||
Two methods support conversion to
|
Two methods support conversion to
|
||||||
and from hexadecimal strings. Since Python's floats are stored
|
and from hexadecimal strings. Since Python's floats are stored
|
||||||
internally as binary numbers, converting a float to or from a
|
internally as binary numbers, converting a float to or from a
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue