I have two float values, I would like to subtract them and compare the result with another value in an if statement. Problem, I didn't manage to have the expected result. I tried to use Decimal module.
from decimal import Decimal, getcontext
getcontext().prec = 3
value_1 = 60.32
value_2 = 59.72
condition = 0.6
sub = Decimal(value_1) - Decimal(value_2)
But,
sub <= condition
FALSE
sub <= Decimal(condition)
FALSE