Hey, all —

I get 5.6000000000000005 as a result (instead of 5.6).
>

Right now formula uses the JavaScript style for displaying numbers by 
default, and it's pretty terrible.  The inaccuracy is "floating point" 
error and any reasonable system would round it off somehow.  To get rid of 
it, refer to the "fixed" and "precision" options in FormulaWidget:  
http://evanbalster.com/tiddlywiki/formulas.html#FormulaWidget

I'm probably going to change how numbers are formatted, likely using 
numeral.js <http://numeraljs.com/> or something like it.  This is one of a 
few compatibility-breaking changes I'm thinking about for the big update.


On Saturday, 13 January 2018 13:28:30 UTC-6, [email protected] wrote:
>
> Hi Evan, 
>
> I just ran into a weird problem. When I enter
>
> (= sum(1.5,1.2,2,0.9) =)
>
> (= 2+1.2+0.9+1.5 =)
>
> I get 5.6000000000000005 as a result (instead of 5.6). If I change the 
> numbers slightly, I get the correct result. 
>
> Is this a bug, or is there a well known explanation I'm not aware of?
>
> Kind regards,
>
> Stef
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4b82fa11-3904-4bbc-a4d1-84f4d20639e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to