News for hackers. Stuff that matters.
Re:0.30000000000000004 by Spidler on Friday November 13, 2015 @06:17AM (#10559200)
But be wary so you don't pass in floats when creating your decimals

    In [10]: from decimal import Decimal
    In [11]: Decimal(0.1) + Decimal(0.2) - Decimal(0.3)
    Out[11]: Decimal('2.775557561565156540423631668E-17')   

    In [12]: Decimal("0.1") + Decimal("0.2") - Decimal("0.3")
    Out[12]: Decimal('0.0')

There are no comments on this comment yet.