This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: asinh() gives NaN on Linux/x86/glibc with optimization on
- To: mlist-egcs at nntp-server dot caltech dot edu
- Subject: Re: asinh() gives NaN on Linux/x86/glibc with optimization on
- From: Shimpei Yamashita <shimpei+usenet+ dot mil+ dot gov at BOFH dot submm dot caltech dot edu>
- Date: 22 Dec 1998 23:58:44 GMT
- Newsgroups: mlist.egcs
- Organization: Hummingbird Heaven
- References: <egcs.m0zsbWu-00038vC@ocean.lucon.org>
H.J. Lu <hjl@lucon.org> writes:
>
>>
>> On RedHat Linux 5.2 (using glibc 2.0.7) for x86, asinh() returns NaN
>> for negative arguments if optimizations are on. The error does not
>> occur if optimizations are turned off. I'm not sure where the problem
>> is--egcs or glibc. Using libc5 seems to solve the problem, but so does
>> dropping back to gcc 2.7.2.
>
>Do you have a testcase?
Sure.
#include <stdio.h>
#include <math.h>
main() {
double ha;
printf("Input argument for asinh: ");
scanf("%lf", &ha);
printf("asinh(%f)=%f\n", ha, asinh(ha));
exit(0);
}
The program works correctly for positive arguments. Negative results
(I tried -100, -50, -10, -5) all return NaN.
--
Shimpei Yamashita <http://www.submm.caltech.edu/%7Eshimpei/>