WeBWorK Main Forum

does tolerance in context affects conditional tests

Re: does tolerance in context affects conditional tests

by Danny Glin -
Number of replies: 0
I believe the answer to your question is yes. When comparing MathObject Reals it considers them equal if they are within the tolerance. Be careful that this applies to MathObjects, but not perl variables.

e.g.
$a = Real(0.00001);
$b = Real(0.00002);
$a == $b should be true with the tolerances you set, whereas

$c = 0.00001;
$d = 0.00002;
$c == $d should be false.