All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Turner <mattst88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Matt Turner <mattst88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [patch] rint.3: Document that halfway cases are rounded to even.
Date: Thu, 12 Mar 2015 18:43:27 -0700	[thread overview]
Message-ID: <1426211007-9986-1-git-send-email-mattst88@gmail.com> (raw)
In-Reply-To: <CAEdQ38EGO7wONjO-3qBNm_aWMX+1WOj0xGrRvE81hTpG-xE79w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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 <mattst88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 man3/rint.3 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/man3/rint.3 b/man3/rint.3
index d1bd302..59402a7 100644
--- a/man3/rint.3
+++ b/man3/rint.3
@@ -94,7 +94,9 @@ format, using the current rounding direction (see
 .BR fesetround (3))
 and without raising the
 .I inexact
-exception.
+exception. When the current rounding direction is to nearest, these
+functions round halfway cases to the even integer in accordance with
+IEEE-754.
 .LP
 The
 .BR rint (),
-- 
2.0.5

--
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

  parent reply	other threads:[~2015-03-13  1:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13  0:43 [patch] rint.3: Document that halfway cases are rounded to even Matt Turner
     [not found] ` <1426207416-7539-1-git-send-email-mattst88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-13  1:06   ` Matt Turner
     [not found]     ` <CAEdQ38EGO7wONjO-3qBNm_aWMX+1WOj0xGrRvE81hTpG-xE79w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-13  1:43       ` Matt Turner [this message]
     [not found]         ` <1426211007-9986-1-git-send-email-mattst88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-22 19:31           ` Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426211007-9986-1-git-send-email-mattst88@gmail.com \
    --to=mattst88-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.