This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH 2/3] PowerPC: remove wrong nearbyintl implementation for, PowerPC64


On 14-03-2014 11:48, Joseph S. Myers wrote:
> On Fri, 14 Mar 2014, Joseph S. Myers wrote:
>
>> On Fri, 14 Mar 2014, Adhemerval Zanella wrote:
>>
>>> +#ifdef TEST_LDOUBLE
>>> +    /* Check cases where first double is a exact integer higher than 2^52 and
>>> +       the precision is determined by second long double for IBM long double.  */
>>> +    TEST_f_f (nearbyint,  34503599627370498.515625L, 34503599627370499.0L),
>>> +    TEST_f_f (nearbyint,  1192568192774434123539907640624.484375L, 1192568192774434123539907640624.0L),
>>> +    TEST_f_f (nearbyint, -34503599627370498.515625L, -34503599627370499.0L),
>>> +    TEST_f_f (nearbyint, -1192568192774434123539907640624.484375L, -1192568192774434123539907640624.0L),
>>> +#endif
>> What are the precision requirements on long double for these inputs to be 
>> representable?  If any require more than 64-bit mantissa, they should be 
>> conditional appropriately on LDBL_MANT_DIG (which may be 64, 106 or 113).
> Note that this applies to the other functions as well.  In some cases a 
> test may accidentally pass without such a conditional, if both the input 
> and expected output round-to-nearest to the same long double value.  But 
> that won't help for these tests when I make rint and nearbyint use the 
> same tests (once 
> <https://sourceware.org/ml/libc-alpha/2014-03/msg00214.html> is reviewed), 
> with the tests for rint systematically expecting "inexact".  (These 
> nearbyint tests in your patch are also missing NO_INEXACT_EXCEPTION, which 
> should be specified as that's the whole difference between rint and 
> nearbyint.)
>
Yes I check here and although 34503599627370498.515625L is representable with 64 bits mantissa,
1192568192774434123539907640624.484375 it is not. I'll fix it accordingly and also on
other ibm ldbl128 rounding fixes. Thanks for catching it. 


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