Subject: | results do not compare numerically as expected |
Math-Round-0.05
perl -v = 5.8.1
uname -a = Linux intercept 2.6.0-test5-mm4 #2 Thu Sep 25 17:05:33 PDT 2003 i686 GNU/Linux
It seems that values returned by nearest() contain a floating point epsilon that prevents proper numeric comparison.
nbest@intercept:~/verifier$ perl -e '
use Math::Round;
print nearest(0.1,0.3)-0.3, "\n";
print "same\n" if nearest(0.1,0.3) == 0.3;
Show quoted text
> '
5.55111512312578e-17
nbest@intercept:~/verifier$
Perhaps you are aware of this, but I thought to bring it to your attention.
My work-around is
. . . sprintf "%0.1f", nearest(0.1, $input->mean());
Let me know if I can provide more detail. Thanks for a useful module.
Neil