The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
As halley indicated, an absolute Epsilon test doesn't work well for all kinds of data. What about fractional comparison? e.g,:
$eps should be the fractional closeness e.g. 0.000000001 would invoke a fractional threshold of a billionth. The chain of ||s ensures that either the divisor is non-zero or division is prevented by returning 1 where both are 0 (therefore equal).
__________________________________________________________________________________
^M Free your mind! In reply to Re: Equality checking for strings AND numbers
by Moron
|
|