Someone pointed out that this isn&#x27;t correct, and then deleted their comment. (?)<p>I now think the behiviour I ascribed to print, is actually what repr does. I&#x27;m not sure about print, but I guess it is just rounding to a certain number of places.<p><pre><code>    &gt;&gt;&gt; from decimal import Decimal

    &gt;&gt;&gt; Decimal(0.1+0.2)
    Decimal(&#x27;0.3000000000000000444089209850062616169452667236328125&#x27;)

    &gt;&gt;&gt; Decimal(0.3)
    Decimal(&#x27;0.299999999999999988897769753748434595763683319091796875&#x27;)

    &gt;&gt;&gt; Decimal(0.300000000000000000000000000001)
    Decimal(&#x27;0.299999999999999988897769753748434595763683319091796875&#x27;)

    &gt;&gt;&gt; print 0.300000000000000000000000000001
    0.3

    &gt;&gt;&gt; repr(0.300000000000000000000000000001)
    &#x27;0.3&#x27;

    &gt;&gt;&gt; D(0.30000000000000004)
    Decimal(&#x27;0.3000000000000000444089209850062616169452667236328125&#x27;)

    &gt;&gt;&gt; repr(0.299999999999999988897769753748434595763683319091796875)
    &#x27;0.3&#x27;

    &gt;&gt;&gt; repr(0.30000000000000004)
    &#x27;0.30000000000000004&#x27;

    &gt;&gt;&gt; print 0.30000000000000004
    0.3</code></pre>