Thread (1 message) 1 message, 1 author, 2015-03-13

Re: [patch] rint.3: Document that halfway cases are rounded to even.

From: Matt Turner <hidden>
Date: 2015-03-13 01:06:03

On Thu, Mar 12, 2015 at 5:43 PM, Matt Turner [off-list ref] wrote:
Per IEEE-754 rounding rules.

The round(3) page describes the behavior of rint and nearbyint in the
halfway cases by saying:

   These functions round x to the nearest integer, but round halfway
   cases away from zero [...], instead of to the nearest even integer
   like rint(3)

Signed-off-by: Matt Turner <redacted>
---
Sorry, this is not precise -- these functions round halfway cases to
nearest even when the rounding mode is set to round-to-nearest. I'll
send a revised patch.

And for what it's worth, as far as I can tell this rounding behavior
(halfway cases round to nearest even) is defined by IEEE-754 and not
the C language spec. I don't know if that's worth mentioning.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help