June 2017
Beginner
352 pages
8h 39m
English
Floating point numbers are supported in Python by the float type. Python floats are implemented as IEEE-754 double-precision floating point numbers with 53 bits of binary precision. This is equivalent to between 15 and 16 significant digits in decimal.
Any literal number containing a decimal point is interpreted by Python as a float:
3.125
Scientific notation can be used, so for large numbers — such as {ParseError: KaTeX\ parse error: Expected 'EOF', got '}' at position 1: }̲3\times10^8{/}, the approximate speed of light in metres per second — we can write:
>>> 3e8300000000.0
and for small numbers like Planck's constant {ParseError: KaTeX parse error:\ Expected 'EOF', got '}' at position 1: }̲1.616\times10^} we can enter:
>>> 1.616e-35 ...
Read now
Unlock full access