Python's decimal module provides support for fast correctly-rounded decimal floating point arithmetic. The decimal module is especially useful for computations involving money and for other applications where exact decimal representation is required.
The float type in Python represents a floating point number. Float values are represented in computer memory by a mantissa and an exponent. The mantissa stores the significant digits of the number while the exponent represents the power of 10 by which the mantissa must be multiplied to obtain the actual value.
While floats are accurate to approximately six or seven decimal places, they can sometimes give unexpected results due to rounding errors. Decimals, on the other hand, have a fixed number of decimal places and no rounding errors will occur. For this reason, decimals are often used for financial calculations.