[LON-CAPA-users] How Best to Resolve Floating Point Issues?

Mills, Douglas G dmills at illinois.edu
Tue Nov 26 16:55:17 EST 2019


Hi All,

I've run into a situation where the binary representation of base 10 numbers is catching up to us for a very small percentage of our students. To illustrate this I've created a public problem demonstrating the issue. Unlike the problems the students get this one, for the sake of demonstration, walks you through the calculations but uses the exact same numbers that one of our students had to work with resulting in a case where what should be zero is not equal to zero. What's the best way of preventing this from happening? (The source code is open also in case you want to have a look but it's pretty well spelled out in the problem itself for demonstration purposes).

https://access3.lon-capa.illinois.edu/res/uiuc/dmills/scratchwork/FloatingPointIssueDemo.problem

Thanks in advance and, on that topic, Happy Thanksgiving!

Doug

DOUGLAS G MILLS
Director of Instructional Technology

Department of Chemistry

University of Illinois at Urbana-Champaign
Chemistry Annex Box A2
601 S. Mathews | M/C 712
Urbana, IL 61801
217.244.5739 | fax: 217.244.8029 | dmills at illinois.edu<mailto:dmills at illinois.edu>
chemistry.illinois.edu<http://chemistry.illinois.edu>

[/var/folders/kv/f3wpy1cs51521x5grm_qx4tw0000gn/T/com.microsoft.Outlook/WebArchiveCopyPasteTempFiles/P698ojxP4tc7j8gMqgPv+E4KQAAAABJRU5ErkJggg==]<http://illinois.edu/>

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20191126/c508de51/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 2604 bytes
Desc: image001.png
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20191126/c508de51/attachment-0001.png>


More information about the LON-CAPA-users mailing list