you are using Decimal &quot;wrong&quot;. If you want it to handle exact values, you need to pass a string with the decimal interpretation<p><pre><code>    Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32
    Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
    &gt;&gt;&gt; from decimal import Decimal
    &gt;&gt;&gt; Decimal(&#x27;0.1&#x27;) + Decimal(&#x27;0.2&#x27;) - Decimal(&#x27;0.3&#x27;)
    Decimal(&#x27;0.0&#x27;)
    &gt;&gt;&gt; Decimal(0.1) + Decimal(0.2) - Decimal(0.3)
    Decimal(&#x27;2.775557561565156540423631668E-17&#x27;)
    &gt;&gt;&gt; Decimal(0.1) == Decimal(&#x27;0.1&#x27;)
    False</code></pre>