[rfc] rint() rounds to even
Ben Collins
bcollins@debian.org
Mon Jan 29 08:32:00 GMT 2001
I have a bug report which I am not sure is a bug or a feature that is
just misunderstood. The rint() function appears to round towards even
numbers. IOW, rint(1.5) and rint(2.5) both return "2.0", aswell
rint(3.5) and rint(4.5) both return "4.0".
Now my math may be a little rusty and old, but I always assumed that
"n.5" always rounded to "n+1". Is this not the case for standard math
functions? If so, is this documented somewhere?
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