in reply to Re^5: Why is Zero not 0?
in thread Why is Zero not 0?

Did you get the + and - swapped? Now comp(5, 4.5, 1) is false and comp(5, 4.5, -1) is true.

Personally I prefer to use the good old standard mathematical way of expressing it:

if (abs($x - $y) <= $tolerance) { print "$x and $y are 'equal'"; }

lodin

Replies are listed 'Best First'.
Re^7: Why is Zero not 0?
by Joost (Canon) on Feb 07, 2008 at 11:50 UTC