This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [rfc] rint() rounds to even
- To: Ulrich Drepper <drepper at cygnus dot com>
- Subject: Re: [rfc] rint() rounds to even
- From: Ben Collins <bcollins at debian dot org>
- Date: Mon, 29 Jan 2001 12:10:24 -0500
- Cc: GNU C Library <libc-alpha at sourceware dot cygnus dot com>
- References: <20010129113144.K921@visi.net> <m3vgqymh0i.fsf@otr.mynet.cygnus.com>
On Mon, Jan 29, 2001 at 08:59:09AM -0800, Ulrich Drepper wrote:
> Ben Collins <bcollins@debian.org> writes:
>
> > Now my math may be a little rusty and old, but I always assumed that
> > "n.5" always rounded to "n+1".
>
> This is highschool math. You don't care there about optimizations for
> limited precision systems. The round to even rule is produce results
> which are arithmetically more stable. The implementation is correct.
That's all fine and well, but the docs say "Round to closest integer",
and nothing about the type of rounding, which should atleast mention
"round-to-even". Not everyone who uses this is doing so for mathematical
formulas and may just want to perform some simple math, which they
assume uses "high school math" of round up at .5
Ben
--
-----------=======-=-======-=========-----------=====------------=-=------
/ Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \
` bcollins@debian.org -- bcollins@openldap.org -- bcollins@linux.com '
`---=========------=======-------------=-=-----=-===-======-------=--=---'