Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Calculation error #134

Open
tilkinsc opened this issue Jul 3, 2022 · 5 comments
Open

Calculation error #134

tilkinsc opened this issue Jul 3, 2022 · 5 comments

Comments

@tilkinsc
Copy link

tilkinsc commented Jul 3, 2022

1 / 9 * 9 == 0.9999999

It should actually be this

1 / 9 * 9 == 1

@sharma62
Copy link

can i fix it

@yuzheng14
Copy link

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

@tilkinsc
Copy link
Author

tilkinsc commented Oct 12, 2022

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

@yuzheng14
Copy link

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.

@tilkinsc
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants