danigm / gnome-shell-calculator

Simple gnome shell calculator in run dialog that you can use with atl+f2
2 stars 0 forks source link

Problem with subtraction #1

Open mokilcde opened 2 years ago

mokilcde commented 2 years ago

Hi!

I try the following in calc (only an example) =1.1-0.9 The result is: =0.20000000000000007

Using Gnome 43 with calc version 11

danigm commented 2 years ago

Yep, that's how javascript works https://jsfiddle.net/tfrdn756/1/, this is related to floating point arithmetic https://en.wikipedia.org/wiki/Floating-point_arithmetic.

This calculator just run the operation with the javascript interpreter and there's no precise math operations or anything like that.