Ah, the joys of IEEE-754...

<$if "anyone wants to see the gory details of fp in javascript (and a slew 
of other languages all of which are dependent on today's CPUs)">
  https://www.h-schmidt.net/FloatConverter/
</$if>

:)

On Saturday, January 13, 2018 at 2:09:28 PM UTC-6, Evan Balster wrote:
>
> 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, ste...@gmail.com 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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/ae3cf949-7c27-43ac-bf57-16c61992d790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to