juras wrote:
> Further investigation of the problem led me to the conclusion
> that there must be a bug inside the /lib/libm.so.6, which is
> a part of glibc-2.3.6 (in my system)
>
> That probably means that I'll have to upgrade glibc. But I am not sure
> if the upgrade - (a rather adventurous task) solves the problem.
>
> LFS-6.3 contains now the glibc-2.5.1.
> I would like to ask someone who has the libc-2.5.1 installed
> to try to compile, run and send the results of the following simple program:
>
> $ cat > tanh.c <<"EOF"
> #include <stdio.h>
> #include <complex.h>
> #include <math.h>
>
> int main()
> {
> complex z=I*M_PI*0.5;
> complex th=ctanh(z);
> printf("z = (%g, %g), ctanh(z) = (%g,%g)\n",
> creal(z),cimag(z),creal(th),cimag(th));
> return 0;
> }
> EOF
>
> $gcc tanh.c -o tanh -lm
> $./tanh
>
> Please send the result for me.
> In my system (glibc-2.3.6 according LFS-6.2)
> the output of the program is:
>
> z = (0, 1.5708), ctanh(z) = (nan, inf)
>
> Which is wrong! (both with gcc-3.3.6 and gcc-4.2.2)
> It should be:
>
> z = (0, 1.5708), ctanh(z) = (0, inf)
Hi:
I am aware that Dan has already solved your problem in the meantime,
but as I went thru the motions, hereinafter my results just for the
record. As you can see, the bug is quite *old*... ;)
Richard
<quote>
GNU C Library stable release version 2.3.3, by Roland McGrath et al.
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.2.2.
Compiled on a Linux 2.4.26 system on 2004-08-28.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
linuxthreads-0.10 by Xavier Leroy
BIND-8.2.3-T5B
libthread_db work sponsored by Alpha Processor Inc
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Report bugs using the `glibcbug' script to <[EMAIL PROTECTED]>.
gcc (GCC) 3.3.3
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-rwxr-x--- 1 rag2 users 6738 Nov 14 10:45 tanh
-rw------- 1 rag2 users 235 Nov 14 10:41 tanh.c
#include <stdio.h>
#include <complex.h>
#include <math.h>
int main()
{
complex z=I*M_PI*0.5;
complex th=ctanh(z);
printf("z = (%g, %g), ctanh(z) = (%g,%g)\n",
creal(z),cimag(z),creal(th),cimag(th));
return 0;
}
z = (0, 1.5708), ctanh(z) = (nan,inf)
**************************************************************************
GNU C Library stable release version 2.5.1, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.2.
Compiled on a Linux 2.6.12 system on 2007-11-04.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
GNU libio by Per Bothner
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
gcc (GCC) 4.1.2
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#include <stdio.h>
#include <complex.h>
#include <math.h>
int main()
{
complex z=I*M_PI*0.5;
complex th=ctanh(z);
printf("z = (%g, %g), ctanh(z) = (%g,%g)\n",
creal(z),cimag(z),creal(th),cimag(th));
return 0;
}
-rwxr-x--- 1 root root 5838 Nov 14 11:14 tanh
-rwxr-xr-x 1 root root 235 Nov 14 11:13 tanh.c
z = (0, 1.5708), ctanh(z) = (0,1.63318e+16)
</quote>
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page