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

Are there ERounding modes which are equivalent to those in the IEEE 754 standard? #23

Open
JoePS1000 opened this issue Dec 1, 2022 · 0 comments

Comments

@JoePS1000
Copy link

JoePS1000 commented Dec 1, 2022

This looks like a great library. I want to be able to round EFloats according to the rounding modes prescribed by the IEEE 754 standard, and described in https://en.wikipedia.org/wiki/IEEE_754#Rounding_rules .

You've got a variety of modes listed in https://github.com/peteroupc/Numbers/blob/master/docs/PeterO.Numbers.ERounding.md . As far as I can see from that Wikipedia link, they correspond as below. Am I right?

  • Round to nearest, ties to even — rounds to the nearest value; if the number falls midway, it is rounded to the nearest value with an even least significant digit: PeterO.Numbers.ERounding.HalfEven.

  • Round to nearest, ties away from zero: PeterO.Numbers.ERounding.HalfUp.

  • Round toward 0 — directed rounding towards zero (also known as truncation): PeterO.Numbers.ERounding.Down.

  • Round toward +∞ — directed rounding towards positive infinity (also known as rounding up or ceiling): PeterO.Numbers.ERounding.Ceiling .

  • Round toward −∞ — directed rounding towards negative infinity (also known as rounding down or floor): PeterO.Numbers.ERounding.Floor .

@JoePS1000 JoePS1000 changed the title Are there ERounding modes which are equivalent to IEEE 754-2008's to-nearest, toward-zero, downward, and upward? Are there ERounding modes which are equivalent to those in the IEEE 754 standard? Dec 1, 2022
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

1 participant