$TOL = 1E-8; # or a sufficiently small number if (abs((36.6 + 0.2) - 38.2) < $TOL) { print "They are (almost) equal!\n"; }