Lines Matching full:decimal
15 fractions. For example, the **decimal** fraction ``0.125``
21 Unfortunately, most decimal fractions cannot be represented exactly as binary
22 fractions. A consequence is that, in general, the decimal floating-point
44 decimal value 0.1 cannot be represented exactly as a base 2 fraction. In base
57 displayed. Python only prints a decimal approximation to the true decimal
59 Python were to print the true decimal value of the binary approximation stored
74 Interestingly, there are many different decimal numbers that share the same
78 approximated by ``3602879701896397 / 2 ** 55``. Since all of these decimal
141 tasks, but you do need to keep in mind that it's not decimal arithmetic and
146 display of your final results to the number of decimal digits you expect.
150 For use cases which require exact decimal representation, try using the
151 :mod:`decimal` module which implements decimal arithmetic suitable for
214 decimal fractions cannot be represented exactly as binary (base 2) fractions.
216 others) often won't display the exact decimal number you expect.
272 55 decimal digits::
278 the decimal value 0.1000000000000000055511151231257827021181583404541015625.
279 Instead of displaying the full decimal value, many languages (including
285 The :mod:`fractions` and :mod:`decimal` modules make these calculations
288 >>> from decimal import Decimal
297 >>> Decimal.from_float(0.1)
298 Decimal('0.1000000000000000055511151231257827021181583404541015625')
300 >>> format(Decimal.from_float(0.1), '.17')