-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rounding-Error: Use proper banker's rounding #153
Comments
So, this is code from Marco Paland's original repository, which I haven't touched. It does seem a bit weird and I need to take another look. ... but I don't quite understand your suggestion, e.g. why do you suggest we avoid the equality operator. |
yeah, this is inherited from the original repo, but it's still wrong compared to the embedded comment. it came up during linting of a code-base. Doing it like that with an extra step might fix some weird float-behavior with very small remainders in the fraction-part?! |
So, I just made it Banker's rounding. |
In fact, I found that when executing this block, there is always Lines 604 to 611 in f8ed5a9
The abs_number here is the absolute value of the original number, and the value of integral depends on whether the number is carried.There are 3 situations at this time
So, there is never |
…'s rounding in `get_components()` * Also added a comment-instead-of-a-testcase for a command in which that roll-over is meaningful
…'s rounding in `get_components()` * Also added a comment-instead-of-a-testcase for a command in which that roll-over is meaningful
Isn't that comparison (first line) wrong considering the following comment?
Link
I think it should be
The text was updated successfully, but these errors were encountered: