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

round: confusing definition of rounding #326

Closed
Ardweaden opened this issue Feb 22, 2022 · 2 comments · Fixed by #327
Closed

round: confusing definition of rounding #326

Ardweaden opened this issue Feb 22, 2022 · 2 comments · Fixed by #327
Assignees
Milestone

Comments

@Ardweaden
Copy link
Contributor

Process ID: round

Describe the issue:
Documentation states:

If the fractional part of x is halfway between two integers, one of which is even and the other odd, then the even number is returned. This behavior follows IEEE Standard 754.

However, based on the definition in the standard, I'm not sure this should hold for integers only. I would expect this would be used at arbitrary point, e.g. round(x=0.25, p=1) => 0.2 and round(p=0.35, p=1) => 0.4.

Proposed solution:
Clarify that the number should be rounded to the one with even least significant digit.

@m-mohr
Copy link
Member

m-mohr commented Feb 22, 2022

Yes, I agree. I'll issue a PR.

@m-mohr
Copy link
Member

m-mohr commented Feb 22, 2022

Please see PR #327. A review would be appreciated.

m-mohr added a commit that referenced this issue Feb 23, 2022
…gers. #326 (#327)

Co-authored-by: Jan Jezeršek <jan.jezersek@gmail.com>
@m-mohr m-mohr closed this as completed Feb 23, 2022
@m-mohr m-mohr modified the milestones: 1.3.0, 2.0.0 Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants