Skip to content
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

Error ROUND_HALF_EVEN? #149

Closed
ibruque opened this issue Dec 21, 2020 · 3 comments
Closed

Error ROUND_HALF_EVEN? #149

ibruque opened this issue Dec 21, 2020 · 3 comments

Comments

@ibruque
Copy link

ibruque commented Dec 21, 2020

We are facing the next problem:
Screenshot 2020-12-21 at 17 39 36
We understand first case is correct, but the second one should be 3.77, right? Are we missing something?

@MikeMcl
Copy link
Owner

MikeMcl commented Dec 22, 2020

I don't know why you think the result should be 3.77 and not 3.78, when the rounding mode is ROUND_HALF_EVEN and 7 is odd and 8 is even.

Use rounding mode 1, i.e. ROUND_DOWN, to get 3.77.

@ibruque
Copy link
Author

ibruque commented Dec 22, 2020

@MikeMcl ok, I understand the behavior now. Is there any way to perform ROUND_HALF_DOWN rounding?

@MikeMcl
Copy link
Owner

MikeMcl commented Dec 22, 2020

Not really, no.

@MikeMcl MikeMcl closed this as completed Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants