-
MathType
-
Wiris Quizzes
-
Learning Lemur
-
CalcMe
-
MathPlayer
-
Store FAQ
-
VPAT for the electronic documentation
-
MathFlow
-
BF FAQ
-
Miscellaneous
Comparison by rounding
Reading time: 1minAs you may have noticed, both significant figures and decimal places comparison methods use the truncation function. Conversely, you may be interested in replicating the same behavior using the rounding function. Below, you can find two alternative procedures to achieve this.
Using absolute error tolerance and a concrete number of decimals assertion
The first option requires combining two assertions we have previously analyzed: absolute error and a concrete number of decimals. If we want to check that the student's answer has exactly n decimal places, and that these match the first n decimal places of the correct answer after rounding, we must set:
- The error margin to
0.5·10⁻ⁿ
- The precision to n decimal places
For instance, if the correct answer is 19.586
Student Answer | |||||
---|---|---|---|---|---|
Decimal places | 19.6 | 19.59 | 19.58 | 19.587 | 19.586 |
1 | ![]() |
![]() |
![]() |
![]() |
![]() |
2 | ![]() |
![]() |
![]() |
![]() |
![]() |
3 | ![]() |
![]() |
![]() |
![]() |
![]() |
4 | ![]() |
![]() |
![]() |
![]() |
![]() |
Using a grading function
The second option requires some programming in CalcMe using a grading function. To check that the first n decimal places of the student and correct answers are identical after rounding, you can define a user-defined routine. For example, for n = 2
.
💡 Tip
You can learn more about grading functions here.
For instance, if the correct answer is 19.586
Student Answer | |||||
---|---|---|---|---|---|
Decimal places | 19.6 | 19.59 | 19.58 | 19.587 | 19.586 |
1 | ![]() |
![]() |
![]() |
![]() |
![]() |
2 | ![]() |
![]() |
![]() |
![]() |
![]() |
3 | ![]() |
![]() |
![]() |
![]() |
![]() |
4 | ![]() |
![]() |
![]() |
![]() |
![]() |