[ww-bugs] Bug 2469: New: This had a rounding problem which confused my students.
bugzilla-daemon at webwork.maa.org
bugzilla-daemon at webwork.maa.org
Mon Oct 15 11:53:56 EDT 2012
http://bugs.webwork.maa.org/show_bug.cgi?id=2469
Summary: This had a rounding problem which confused my
students.
Product: Problem libraries
Version: unspecified
Platform: PC
URL: /opt/webwork/courses/math131fall2012/templates/Library
/ma122DB/set3/s3_1_44.pg_with_problemSeed=3972
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P5
Component: Library
AssignedTo: jj at asu.edu
ReportedBy: blake at math.wustl.edu
Web browser ---
version:
My seed: 3972
My fix. The original:
$pol=nicestring([$a[3], $a[2], $a[1], $a[0]], ['x^3', 'x^2', 'x', '']);
What I added/changed:
$rnumber = 1000000;
$b3 = int( $a[3]*$rnumber + .5 )/ $rnumber;
$b2 = int( $a[2]*$rnumber + .5 )/ $rnumber;
$b1 = int( $a[1]*$rnumber + .5 )/ $rnumber;
$b0 = int( $a[0]*$rnumber + .5 )/ $rnumber;
$pol=nicestring([$b3, $b2, $b1, $b0], ['x^3', 'x^2', 'x', '']);
It still wasn't perfect, but probably good enough.
Thanks,
--
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