## WeBWorK Problems

### small number woes

by Zak Zarychta -
Number of replies: 3
Hi,

I cannot get WeBWorK answer checker to correctly process numbers of a small magnitude

I'm authoring questions for a quantum physics module where answers are often of a small magnitude. I have some constants set such as Planck's constant. I have an answer for a question that is 1.441e-29

Setting zeroLevel to allow small numbers seems to have no effect.

Trying

ANS(Real(1.441E-29)->cmp(
tolType => 'absolute',
tolerance => 1.441E-31,
));

still grades as incorrect 1.441E-29 and gives the correct answer as 0. Infact the numerical example cited in the thread yields the same result

Any ideas, what I am doing wrong?

### Re: small number woes

by Zak Zarychta -
So with the answer checker I have found that setting the zero level small works for example

Context("Numeric");
Context()->flags->set(
zeroLevel => 1E-36,
zeroLevelTol => 1E-38
);

However, it will still not work with units in the question. So

ANS(Real($ans)->cmp()); # Works but ANS( num_cmp($ans, units=>"kg m s^-1" ) ); # does not work

However defining $ans as$ans = NumberWithUnits("1E-30 kg m s^-1");

works with the first answer checker and the zero tolerance accordingly set

Could anyone elaborate why this might be so?

### Re: small number woes

by Joel Trussell -
I realize that you desire the standard MKS units but changing to CGS moves you a bit further up the scale ( by 10^5) . We have some similar problems in electrical engineering. Fortunately we have terahertz  to Hertz, picofarads to farads, etc, so it is easier.
$zeroLevel = 1E-36;$zeroLevelTol = 1E-38;