From: jj v. a. <we...@ma...> - 2005-08-24 01:33:45
|
Log Message: ----------- Hopefully fixed the logic of setting numerical tolerance defaults. Modified Files: -------------- pg/macros: extraAnswerEvaluators.pl Revision Data ------------- Index: extraAnswerEvaluators.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/extraAnswerEvaluators.pl,v retrieving revision 1.12 retrieving revision 1.13 diff -Lmacros/extraAnswerEvaluators.pl -Lmacros/extraAnswerEvaluators.pl -u -r1.12 -r1.13 --- macros/extraAnswerEvaluators.pl +++ macros/extraAnswerEvaluators.pl @@ -189,17 +189,21 @@ $context = $Parser::Context::Default::context{'Complex'}; } $options{tolType} = $options{tolType} || 'relative'; - $options{tolerance} = $options{tolerance} || $options{tol} || - $options{reltol} || $options{relTol} || $options{abstol} || 1; + $options{tolType} = 'absolute' if defined($options{tol}); $options{zeroLevel} = $options{zeroLevel} || $options{zeroLevelTol} || $main::numZeroLevelTolDefault; - if ($options{tolType} eq 'absolute' or defined($options{tol}) - or defined($options{abstol})) { + if ($options{tolType} eq 'absolute' or defined($options{abstol})) { + $options{tolerance} = $options{tolerance} || $options{tol} || + $options{reltol} || $options{relTol} || $options{abstol} || + $main::numAbsTolDefault; $context->flags->set( tolerance => $options{tolerance}, tolType => 'absolute', ); } else { + $options{tolerance} = $options{tolerance} || $options{tol} || + $options{reltol} || $options{relTol} || $options{abstol} || + $main::numRelPercentTolDefault; $context->flags->set( tolerance => .01*$options{tolerance}, tolType => 'relative', |