P is for Practical | |
PerlMonks |
Re^3: Equality checking for strings AND numbersby DrHyde (Prior) |
on Jul 17, 2007 at 09:31 UTC ( [id://626987]=note: print w/replies, xml ) | Need Help?? |
I'd argue that if you're bothering to mention precision at all, then 10.0 != 10.00. 10.0 is really "somewhere between 9.95 and 10.05", and 10.00 is really "somewhere between 9.995 and 10.005". So if your 10.0 is really 9.97, it can't possibly be equal to 10.00.
In Section
Seekers of Perl Wisdom
|
|