Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4a3c7c4e
Commit
4a3c7c4e
authored
Nov 07, 2010
by
Mark Dickinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #10145: the float.is_integer method was undocumented.
parent
35adf5dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
Doc/library/stdtypes.rst
Doc/library/stdtypes.rst
+14
-4
No files found.
Doc/library/stdtypes.rst
View file @
4a3c7c4e
...
...
@@ -530,10 +530,20 @@ The float type has some additional methods.
.. method:: float.as_integer_ratio()
Return a pair of integers whose ratio is exactly equal to the
original float and with a positive denominator. Raises
:exc:`OverflowError` on infinities and a :exc:`ValueError` on
NaNs.
Return a pair of integers whose ratio is exactly equal to the
original float and with a positive denominator. Raises
:exc:`OverflowError` on infinities and a :exc:`ValueError` on
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
and from hexadecimal strings. Since Python's floats are stored
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment