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

                    • 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 behaviour with the rounding function. Below you can find two alternative procedures to do so.

                    Using absolute error tolerance and a concrete number of decimals assertion

                    The first option will require 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 exactly has n decimal places, and these are identical to the correct answer first n decimal places after rounding, we need to set the error margin to 0.5·10-n and define 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 will require some programming in CalcMe through a grading function. If we want to check that the first n decimal places of the student and correct answers are identical after rounding, we need to define the following user-defined routine (for n=2).  

                    Tip

                    You can see 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 Tip

                    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