[samigo-team] Floating point numbers

Sam Ottenhoff ottenhoff at longsight.com
Tue Mar 5 08:34:09 PST 2013


I gave it a try, but it involves 1000+ changes.  It probably makes sense to
just improve precision and move from floats to doubles instead.  The
gradebook records POINTS_EARNED as a double.


On Thu, Feb 28, 2013 at 2:16 PM, Karen Tsao <ktsao at stanford.edu> wrote:

> Thanks for everyone's input.
>
> Sam,
>
> Could you please make the change? Thanks!
>
> Karen
>
>
> On Thu, Feb 28, 2013 at 6:19 AM, David Horwitz <david.horwitz at uct.ac.za>wrote:
>
>>  There's a another issue (fixable without replacing floats but still)
>>
>> There are several places in the code where direct foat comparisons are
>> made:
>>
>> Float a =
>> Float b,
>>
>> if (a.equals(b))
>>
>> For instance to check if an answer has been updated etc. We could be
>> getting extra updated because of slight differences in the float
>> representation ...
>>
>> D
>>
>>
>> On Thu, 2013-02-28 at 09:11 -0500, Sam Ottenhoff wrote:
>>
>>
>>  But just curious, what is the advantage of this change? Is this for
>> getting a more precise score? Like some 0.999 issue?
>>
>>
>>
>>  An instructor created a complex placement exam that used point scores
>> in the millions, thousands, hundreds, etc. as a way of being able to
>> quickly see points in various sections in the final score (example:
>> 27005508.06 could be broken up to see that the student scores 06 on sec 1,
>> 08, on sec 2, 55 on sec 3, 27 on sec 4).
>>
>>
>>
>>  So the reason why floating point numbers aren't used for money:
>>
>>
>>
>>  > create table floattest (z float);
>>
>> > insert into floattest VALUES (*2075808*);
>>
>> > select * from floattest;
>>
>>
>>
>>  The result: *2075810*
>>
>>  _______________________________________________
>> samigo-team mailing listsamigo-team at collab.sakaiproject.orghttp://collab.sakaiproject.org/mailman/listinfo/samigo-team
>>
>>
>> ------------------------------
>> UNIVERSITY OF CAPE TOWN
>>
>> This e-mail is subject to the UCT ICT policies and e-mail disclaimer
>> published on our website at
>> http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27
>> 21 650 9111. This e-mail is intended only for the person(s) to whom it
>> is addressed. If the e-mail has reached you in error, please notify the
>> author. If you are not the intended recipient of the e-mail you may not
>> use, disclose, copy, redirect or print the content. If this e-mail is not
>> related to the business of UCT it is sent by the sender in the sender's
>> individual capacity.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/samigo-team/attachments/20130305/2cc9f4d7/attachment.html 


More information about the samigo-team mailing list