This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] BZ#13889: expl (709.75) wrongly overflows for ldbl-128ibm
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 22 Mar 2013 12:42:05 -0300
- Subject: Re: [PATCH] BZ#13889: expl (709.75) wrongly overflows for ldbl-128ibm
- References: <5134A6D4 dot 5080101 at linux dot vnet dot ibm dot com> <Pine dot LNX dot 4 dot 64 dot 1303041548240 dot 25031 at digraph dot polyomino dot org dot uk> <51373914 dot 7040602 at linux dot vnet dot ibm dot com> <Pine dot LNX dot 4 dot 64 dot 1303061626460 dot 12534 at digraph dot polyomino dot org dot uk> <51378E2D dot 4060103 at linux dot vnet dot ibm dot com> <5148B1F3 dot 3040508 at linux dot vnet dot ibm dot com> <514B5B5B dot 8070504 at suse dot com>
On 03/21/2013 04:11 PM, Andreas Jaeger wrote:
> On 03/19/2013 07:44 PM, Adhemerval Zanella wrote:
>> +static const long double
>> +o_threshold = 709.78271289338399678773454114191496482L,
>> +u_threshold = -744.44007192138126231410729844608163411L;
>> +
>> +long double __expl(long double x) /* wrapper exp */
>
> Could you fix the formatting issues, please? Add spaces before the opening braces in all cases.
Fixed.
>
>> +{
>> +#ifdef _IEEE_LIBM
>
> I know you copy & pasted this code but I think that we can remove this check for _IEEE_LIBM completely. Care for a followup patch to cleanup all usages?
Good idea, I'll check for these in ldbl128-ibm implementation.
>
>> + return __ieee754_expl(x);
>> +#else
>> + long double z;
>> + z = __ieee754_expl(x);
>> + if (_LIB_VERSION == _IEEE_)
>> + return z;
>> + if (__finitel(x))
>> + {
>> + if (x >= o_threshold)
>> + return __kernel_standard_l(x,x,206); /* exp overflow */
>> + else if (x <= u_threshold)
>> + return __kernel_standard_l(x,x,207); /* exp underflow */
>> + }
>> + return z;
>> +#endif
>> +}
>> +hidden_def (__expl)
>> long_double_symbol (libm, __expl, expl);
>> +
>
> git push will not allow an empty line at the end of the file, better fix it directly ;)
>
> Ok with the proposed changes,
>
Fixed and pushed as e42a38dd9dd4bbeb0fbd6e99f35d796ba37b6879. Thanks for the review.