Perl: the Markov chain saw | |
PerlMonks |
Re: String comparison of numbersby philcrow (Priest) |
on Mar 09, 2006 at 15:21 UTC ( [id://535409]=note: print w/replies, xml ) | Need Help?? |
When comparing floating point numbers, you should either round them both to the same precision and compare or subtract one from the other and see if the abs of the result is small:
Numerical analysts usually prefer the latter many programmers prefer the former. Phil
In Section
Seekers of Perl Wisdom
|
|