Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^2: False positive on inequality comparisonby Nkuvu (Priest) |
on Apr 03, 2009 at 21:54 UTC ( [id://755351]=note: print w/replies, xml ) | Need Help?? |
I'm familiar with potential problems with floating point inequality when the values are the results of some computation. But if I assign 1.2345 to $var_a and then assign 1.2345 to $var_b, then perform the equality check, I would expect them to be equal. Direct assignments should not cause different floating point representations, as far as I know. Once that value is used in any sort of arithmetic, all bets are off. As an additional test, I wrote a short script (which I should have done earlier, but it still doesn't really explain anything):
Every single comparison there passes the equality check. And the only thing this script is doing differently than my actual script is reading the values from Excel. That may be key, I don't know.
In Section
Seekers of Perl Wisdom
|
|