Skip to content

Mantissa Check

mkraska edited this page Apr 29, 2022 · 6 revisions

Procedure based on this forum discussion.

This check is implemented in the feedback function fb_unit.

Question variables

ra(x,y):=stack_units_nums(stack_unit_si_to_si_base(x))/stack_units_nums(stack_unit_si_to_si_base(y));
mantissaOK(x,y,tol):= is( abs(round( log(ra(x,y))/log(10))-log(ra(x,y))/log(10))<tol); 

PRT

This example is in the context of a unitless question design but input with units.

Field Value
Answer test AlgEquiv
SAns mantissaOK(S_A/m^2,A,0.005) Answer S_A with units is made unitless, compared to unitless reference A
TAns true
true feedback Die Mantisse stimmt, die Zehnerpotenz weicht aber um mindestens eine Größenordnung ab. Prüfen Sie Ihre Einheitenumrechnung.

Tryout Space

In order to try code snippets in jsfiddle,

  1. copy the code from the wiki page to the clipboard
  2. follow the link for the JSXGraph version you want to try
  3. Replace the code in the HTML section (contents of <p hidden id="init">) with the content of the clipboard
Clone this wiki locally