You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 .
The text was updated successfully, but these errors were encountered:
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
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
.The text was updated successfully, but these errors were encountered: