Fix(guide): Edited formatting (#32583)
* Fix(guide): Edited formatting * Update index.mdpull/35773/head^2
parent
20dc570df7
commit
07981cd3f5
|
@ -1,10 +1,13 @@
|
|||
---
|
||||
title: Python Floating Point Numbers
|
||||
---
|
||||
# Python Floating Point Numbers
|
||||
|
||||
Some general information about floating point numbers and how they work in Python, can be found <a href='https://docs.python.org/3/tutorial/floatingpoint.html' target='_blank' rel='nofollow'>here</a>.
|
||||
|
||||
Nearly all implementations of Python follow the IEEE 754 specification: Standard for Binary Floating-Point Arithmetic. More information found on the <a href='http://grouper.ieee.org/groups/754/' target='_blank' rel='nofollow'>IEEE site</a>.
|
||||
|
||||
## Float objects using floating point literals
|
||||
Float objects can be created using using <a href='https://docs.python.org/3/reference/lexical_analysis.html#floating-point-literals' target='_blank' rel='nofollow'>floating point literals</a>:
|
||||
|
||||
>>> 3.14
|
||||
|
@ -47,6 +50,7 @@ Note that leading and trailing zero(s) are valid for floating point literals
|
|||
>>> 001e0010 # Same as 1e10
|
||||
10000000000.0
|
||||
|
||||
## Float objects using float constructors
|
||||
The <a href='https://docs.python.org/3/library/functions.html#float' target='_blank' rel='nofollow'>`float`</a> constructor is another way to create `float` objects.
|
||||
|
||||
Creating `float` objects with floating point literals is preferred when possible:
|
||||
|
|
Loading…
Reference in New Issue