This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[rfc] rint() rounds to even


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  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]