calculator icon indicating copy to clipboard operation
calculator copied to clipboard

Calculation error

Open tilkinsc opened this issue 3 years ago • 5 comments

1 / 9 * 9 == 0.9999999

It should actually be this

1 / 9 * 9 == 1

tilkinsc avatar Jul 03 '22 00:07 tilkinsc

can i fix it

sharma62 avatar Sep 29 '22 12:09 sharma62

It is practically 0.9999999. Because the calculator calculator the 1/9 first, then it multiply the result of 1/9 and 9, then it get 0.9999999999

yuzheng14 avatar Oct 11 '22 22:10 yuzheng14

It is practically 0.9999999. Because the calculator calculator the 1/9 first, then it multiply the result of 1/9 and 9, then it get 0.9999999999

Huh? Also, its widely accepted that this isn't a correct calculation and its not. f(x) = x / 9 * 9 f(f(f(f(f(1))))) != 1

It's gradual depreciation

tilkinsc avatar Oct 12 '22 01:10 tilkinsc

It is practically 0.9999999. Because the calculator calculator the 1/9 first, then it multiply the result of 1/9 and 9, then it get 0.9999999999

Huh? Also, its widely accepted that this isn't a correct calculation and its not. f(x) = x / 9 * 9 f(f(f(f(f(1))))) != 1

It's gradual depreciation

But, it's divide into two steps, and convert to float, so that it will lose a little bit accuracy among the process.

yuzheng14 avatar Oct 12 '22 03:10 yuzheng14

Its not an int to float conversion its all doubles and stays doubles.

tilkinsc avatar Oct 12 '22 04:10 tilkinsc