in reply to When is a 2 not a 2?
My Math::BigApprox is smarter than regular floating point numbers. It knows that $x == $y iff $x eq $y so you won't have that problem when using it:
use Math::BigApprox 'c';
my $x= c(1);
while( $x < 2 ) {
print "$x\n";
$x += 0.1;
}
print "Stop: x=$x\n";
print "Not 2\n" if $x != 2;
and such numbers have about the same precision as floating point when using such small numbers, they don't have a big performance impact (mostly just the cost of overload.pm), and you can compute 500,000! (factorial, about 1.0228e+2632341) without overflowing nor taking all day.
...which gives me another idea for a very simple module. Math::Eq ?
Re^2: When is a 2 not a 2? (eq) by halley (Prior) on Jan 31, 2008 at 13:43 UTC 
tye, you may already know of this, but I'll reiterate that anyone who is interested in implementing a "comparing floating point numbers" feature should read this article. http://www.cygnussoftware.com/papers/comparingfloats/comparingfloats.htm
In the olden days, people would compare using a chosen EPSILON. if (abs($a  $b) < $EPSILON) { ... } If you know about the uneven resolution of floats, you learn that EPSILON must be chosen carefully for each comparison. Better to know something about the format of IEEE floats (the most common implementation on modern computers) and some fast and flexible ways to make a suitable AlmostEqual() function that lets you use a tolerance that is tied to the resolution, not the decimal position of the error.
Comparing floats is a huge gotcha for newcomers or writers of quick adhoc code, and easy to do wrong. I would rather that highlevel programming languages melt such comparison features into the language, say, with an A =~ B floating point operator. (Whether regex or float, that can be read as "does A bind with B.") Then, the default tolerance can be set to a suitable "about one decimal place" and overridden through a pragma or language variable. But I digress.
 [ e d @ h a l l e y . c c ]
 [reply] [d/l] [select] 
