This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Clean up dbl-64 rint, nearbyint
On Tue, 13 Mar 2012, Richard Henderson wrote:
> On 03/12/12 17:45, Joseph S. Myers wrote:
> > Richard, looking at other versions of these functions I'm suspicious
> > of the alpha versions of nearbyint and nearbyintf (which just add and
> > subtract 0x1p23 or 0x1p52 without checking the size of the argument).
> > At least for normal IEEE arithmetic, that's not correct (for double,
> > consider an argument of 0x1p52 + 1, for example, which is an integer
> > but whose value will be changed when 0x1p52 is added and subtracted).
> > If the alpha versions do indeed get such cases wrong I guess it's
> > evidence we need more testcases for rint and nearbyint to cover these
> > cases of large integer arguments.
>
> Yes, that definitely looks wrong. It should look pretty much exactly
> like rint, with the range check first.
Thanks for the confirmation. If you're not getting to a fix soon then
filing a ports bug in Bugzilla for the issue would probably be a good
idea.
(I'd consider the associated libc testcases for this issue to be obvious,
given a sanity check that they do indeed pass on x86_64.)
--
Joseph S. Myers
joseph@codesourcery.com