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

Incorrect result when rounding 1/3 with MidpointRounding.ToEven #39

Closed
lipchev opened this issue Apr 14, 2024 · 0 comments · Fixed by #40
Closed

Incorrect result when rounding 1/3 with MidpointRounding.ToEven #39

lipchev opened this issue Apr 14, 2024 · 0 comments · Fixed by #40

Comments

@lipchev
Copy link
Contributor

lipchev commented Apr 14, 2024

I've messed up one of the edge cases in the implementation of #23

  Name Value Type
Fraction.Round(new Fraction(1,3), 2, MidpointRounding.ToEven) {17/50} Fractions.Fraction
  Fraction.Round(new Fraction(1,3), 2, MidpointRounding.ToEven).ToDecimal() 0.34 decimal
lipchev added a commit to lipchev/Fractions that referenced this issue Apr 14, 2024
…Rounding.ToEven

- adds extra tests for the non-terminating fractions
danm-de added a commit that referenced this issue Apr 15, 2024
fixes #39 : Incorrect result when rounding 1/3 with MidpointRounding.ToEven
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

Successfully merging a pull request may close this issue.

1 participant