Documentation / WirisQuizzes

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • Wiris Quizzes

      • Learning Lemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Miscellaneous

                      • Home
                      • Wiris Quizzes
                      • Validation Options
                      • Numbers representation, tolerance and precision
                      • Numbers representation, tolerance and precision

                      Comparison by rounding

                      Reading time: 1min

                      As 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

                      Was this article helpful?

                      Yes
                      No
                      Give feedback about this article

                      Related Articles

                      • Debugging (what to do if it isn't working)
                      • Repeating decimal
                      • Integers and rounding

                      Comparison by rounding

                      Using absolute error tolerance and a concrete number of decimals assertion Using a grading function

                      Making people’s STEM work more meaningful

                      MathType

                      • MathType for Office Tools
                      • MathType for Mac
                      • MathType for Microsoft 365
                      • MathType for Google Workspace
                      • MathType for LMS
                      • MathType for XML Editors
                      • Arabic notation
                      • Our products accessibility
                      • MathType is online

                      WirisQuizzes

                      Learning Lemur

                      Solutions for Education

                      • Blackboard Learn
                      • Brightspace by D2L
                      • Canvas
                      • Google Classroom
                      • Moodle
                      • Schoology

                      Solutions for Publishing Houses

                      Solutions for Technical Writers

                      Solutions for Chemistry

                      Integrations

                      • HTML Editors
                      • MathType in WordPress

                      Pricing

                      Company

                      Careers

                      Blog

                      Contact Us

                      Buy Now

                      Plugin Downloads

                      © Wiris 2025

                      • Cookie Settings
                      • Cookie Policy
                      • Terms of Use
                      • Privacy Policy / GDPR
                      • Student Data Privacy
                      • Compliance
                      • Powered by Helpjuice
                      Expand