Skip to content
Prev Previous commit
Next Next commit
Fix doctests: Missing import and counterfactual example.
  • Loading branch information
rhettinger committed Feb 19, 2023
commit d8bcc4cd3efe3f5a8d1ff890e46ad29cac0a40e3
5 changes: 2 additions & 3 deletions Doc/tutorial/floatingpoint.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.. testsetup::

import math
from fractions import Fraction

.. _tut-fp-issues:

Expand Down Expand Up @@ -57,9 +58,7 @@ Many users are not aware of the approximation because of the way values are
displayed. Python only prints a decimal approximation to the true decimal
value of the binary approximation stored by the machine. On most machines, if
Python were to print the true decimal value of the binary approximation stored
for 0.1, it would have to display:

.. doctest::
for 0.1, it would have to display::

>>> 0.1
0.1000000000000000055511151231257827021181583404541015625
Expand Down