<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:13.0pt">I encountered this problem recently when testing to be sure that students were correctly entering the difference between two columns of experimental data.  My checking was taking place in JavaScript, not in
 Perl and I found this article to be very helpful for what I was doing. I'm sure this is not directly applicable to your situation, Gene, but nevertheless may be helpful?  I can provide more info on what I did and how my testing works if anyone is interested.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt">https://www.jacklmoore.com/notes/rounding-in-javascript/<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:13.0pt;color:#13294B">Doug<span style="text-transform:uppercase"><o:p></o:p></span></span></p>
<p class="MsoNormal"><b><span style="color:#13294B;text-transform:uppercase"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span style="color:#13294B;text-transform:uppercase">DOUGLAS G MILLS</span></b><span style="color:black"><br>
</span><i><span style="color:#13294B">Director of Instructional Technology</span></i><span style="color:black"><br>
 <br>
</span><span style="color:#13294B">Department of Chemistry</span><span style="color:black"><br>
<br>
</span><span style="color:#13294B">University of Illinois at Urbana-Champaign</span><span style="color:black"><br>
</span><span style="color:#13294B">Chemistry Annex Box A2</span><span style="color:black"><br>
</span><span style="color:#13294B">601 S. Mathews | M/C 712</span><span style="color:black"><br>
</span><span style="color:#13294B">Urbana, IL 61801</span><span style="color:black"><br>
</span><span style="color:#13294B">217.244.5739 | <i>fax</i>: 217.244.8029 | </span><a href="mailto:dmills@illinois.edu">dmills@illinois.edu</a><span style="color:black"><br>
</span><span style="color:#13294B"><a href="http://chemistry.illinois.edu">chemistry.illinois.edu</a></span><span style="color:black"><br>
 <br>
</span><a href="http://illinois.edu/"><span style="color:windowtext;text-decoration:none"><img border="0" width="119" height="21" style="width:1.2395in;height:.2187in" id="_x0000_i1026" src="cid:image001.png@01D571F0.3D04C470" alt="/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg=="></span></a><span style="color:black"><br>
<br>
</span><i><span style="color:#666666">Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure. </span></i><o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:13.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:13.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">LON-CAPA-users <lon-capa-users-bounces@mail.lon-capa.org> on behalf of Peter Riegler <p.riegler@ostfalia.de><br>
<b>Reply-To: </b>Discussion list for LON-CAPA users <lon-capa-users@mail.lon-capa.org><br>
<b>Date: </b>Sunday, September 22, 2019 at 7:35 AM<br>
<b>To: </b>"Harding, Gene L" <glhardin@purdue.edu>, Discussion list for LON-CAPA users <lon-capa-users@mail.lon-capa.org><br>
<b>Subject: </b>Re: [LON-CAPA-users] FW: Rounding Issue<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<p style="margin-left:.5in">Hi Gene,<o:p></o:p></p>
<p style="margin-left:.5in">most likely the problem is one of number representation (which contributes to rounding errors).<o:p></o:p></p>
<p style="margin-left:.5in">The binary representation of $Av+0.05 is (by which I mean "the result of binary representation of $Av plus binary respresentation of 0.05 as a binary")<o:p></o:p></p>
<p style="margin-left:.5in">10.101100110011001100110011001100110011001100110011001<o:p></o:p></p>
<p style="margin-left:.5in">whereas the binary representation of 2.7 is<o:p></o:p></p>
<p style="margin-left:.5in">10.101100110011001100110011001100110011001100110011010<o:p></o:p></p>
<p style="margin-left:.5in">Both binary numbers differ only in the last two digits and the second one is larger. That explains why 2.7 is not accepted.<o:p></o:p></p>
<p style="margin-left:.5in">I have done the computations on  64-bit machine which likely matches your server's resolution.<o:p></o:p></p>
<p style="margin-left:.5in">I hope this is of help.<o:p></o:p></p>
<p style="margin-left:.5in">Peter<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">Am 22.09.2019 um 02:51 schrieb Harding, Gene L:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-left:.5in"><span style="color:#1F497D">Hi everyone,</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">I have a quiz problem in LC that seems to be doing some odd things with the rounding. I have successfully recreated the problem reported by one of my students, but cannot figure out why it happens.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">The answer to the problem (part c) is 2.65 on the dot. The problem requests an answer with one place after the decimal, and the tolerance is +/- 0.05. In this case, since the value computes to exactly 2.65, LC should
 take anything from 2.6 to 2.7. In fact, in author view LC indicates it will take anything from 2.6 to 2.7:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><img border="0" width="274" height="34" style="width:2.8541in;height:.3541in" id="Picture_x0020_1" src="cid:image002.jpg@01D571F0.3D04C470" alt="cid:part1.99A52A7F.672D8F68@ostfalia.de"><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">The trouble is that 2.6 works, 2.65 works, but 2.7 does not.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">This is the Perl script calculation (Rf=33, Ri=20):<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">$Av         = 1+$Rf/$Ri;           # Gain 
<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">This is the response code:<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><numericalresponse unit="" format="1f" answer="$Av" id="3"><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">        <responseparam name="tol" type="tolerance" default="0.05" description="Numerical Tolerance" /><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">        <textline readonly="no" spellcheck="none" /><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"></numericalresponse><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">Any idea what the problem is? I am baffled.<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">Best regards,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">Gene L. Harding, PE<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">Associate Professor of ECET<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">Purdue University<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">574-520-4190<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__polytechnic.purdue.edu_south-2Dbend_&d=DwMD-g&c=OCIEmEwdEq_aNlsP4fF3gFqSN-E3mlr2t9JcDdfOZag&r=d6Snpw24IWBdGQpe7yVTtlsEXqfulT1FGlRs-RT3y9s&m=lNqg2OTmaYK8aMffQM-PWQXcFIk8OeCaYOBvj1cHHZA&s=--f9TNkjaTX7CsLeCDgFX1DlFFmex8OEDMVnuTv1iVI&e="><font color="red"><b>MailScanner has detected a possible fraud attempt from "urldefense.proofpoint.com" claiming to be</b></font> https://polytechnic.purdue.edu/south-bend/</a><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><br>
<br>
<o:p></o:p></p>
<pre style="margin-left:.5in">_______________________________________________<o:p></o:p></pre>
<pre style="margin-left:.5in">LON-CAPA-users mailing list<o:p></o:p></pre>
<pre style="margin-left:.5in"><a href="mailto:LON-CAPA-users@mail.lon-capa.org">LON-CAPA-users@mail.lon-capa.org</a><o:p></o:p></pre>
<pre style="margin-left:.5in"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__mail.lon-2Dcapa.org_mailman_listinfo_lon-2Dcapa-2Dusers&d=DwMD-g&c=OCIEmEwdEq_aNlsP4fF3gFqSN-E3mlr2t9JcDdfOZag&r=d6Snpw24IWBdGQpe7yVTtlsEXqfulT1FGlRs-RT3y9s&m=lNqg2OTmaYK8aMffQM-PWQXcFIk8OeCaYOBvj1cHHZA&s=fFuQTInd6fZaePeX7oUVGIfuQupRxyBgTktumFXVqkU&e="><font color="red"><b>MailScanner has detected a possible fraud attempt from "urldefense.proofpoint.com" claiming to be</b></font> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</a><o:p></o:p></pre>
</blockquote>
<pre style="margin-left:.5in">-- <o:p></o:p></pre>
<pre style="margin-left:.5in">Peter Riegler<o:p></o:p></pre>
<pre style="margin-left:.5in">Fakultät Informatik<o:p></o:p></pre>
<pre style="margin-left:.5in">Ostfalia Hochschule für angewandte Wissenschaften<o:p></o:p></pre>
<pre style="margin-left:.5in">- Hochschule Braunschweig/Wolfenbüttel<o:p></o:p></pre>
<pre style="margin-left:.5in">Salzdahlumer Str. 46/48<o:p></o:p></pre>
<pre style="margin-left:.5in">38302 Wolfenbüttel<o:p></o:p></pre>
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in">Tel 05331 939 31540<o:p></o:p></pre>
<pre style="margin-left:.5in">Fax 05331 939 31542<o:p></o:p></pre>
<pre style="margin-left:.5in">Web <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ostfalia.de_pws_riegler&d=DwMD-g&c=OCIEmEwdEq_aNlsP4fF3gFqSN-E3mlr2t9JcDdfOZag&r=d6Snpw24IWBdGQpe7yVTtlsEXqfulT1FGlRs-RT3y9s&m=lNqg2OTmaYK8aMffQM-PWQXcFIk8OeCaYOBvj1cHHZA&s=zEp_gv4MSfwthw4VS8lD3vtw2EEyoA4XJmiQK8H2rFQ&e="><font color="red"><b>MailScanner has detected a possible fraud attempt from "urldefense.proofpoint.com" claiming to be</b></font> www.ostfalia.de/pws/riegler</a> <o:p></o:p></pre>
</div>
</body>
</html>