That's so weird!! I thought this was all standardized.
Anybody know any way to make this portable across all the platforms?
When dealing with reals, you usually need to compare within a tolerance.
a == b
is equivalent to
a - b == 0
and to
|a - b| <= 0
With a tolerance, it becomes
|a - b| <= tol
Tolerance can be absolute
(e.g. tol = 0.0001)
or relative
(e.g. tol = a * 0.05)
In reply to Comparing Reals using a Tolerance
by ikegami
in thread bug in Perl compilation?
by bkgallo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |