[ww-bugs] Bug 4086: New: perl rounding issue

bugzilla-daemon at webwork.maa.org bugzilla-daemon at webwork.maa.org
Thu Mar 1 14:13:58 EST 2018


http://bugs.webwork.maa.org/show_bug.cgi?id=4086

           Summary: perl rounding issue
           Product: Problem Libraries
           Version: unspecified
          Platform: PC
               URL: /opt/webwork/courses/MATH2441/templates/Library/UBC/ST
                    AT/STAT302/HW04/HW04-02.pg_with_problemSeed=1234
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Library (OPL)
        AssignedTo: gjennings at csudh.edu
        ReportedBy: wub7quxa at gmail.com
        Web browser Firefox
           version:


This question uses the following code to round answers to 3 digits
(line 31)

$ans_a = sprintf("%.3f", ($tar*$lat)/10000.);

the problem is that this will round a number like 0.4355 down to 0.435
rather than up to 0.436, which is what the students would rightfully
expect. However, the answer 0.436 would be rejected as incorrect. I
suggest using a different way to round the number or to introduce some
numerical tolerance.

-- 
Configure bugmail: http://bugs.webwork.maa.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the webwork-bugs mailing list