[rfc] rint() rounds to even
Ben Collins
bcollins@debian.org
Mon Jan 29 09:10:00 GMT 2001
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 '
`---=========------=======-------------=-=-----=-===-======-------=--=---'
More information about the Libc-alpha
mailing list