On Nov 13, 2007 10:42 AM, juras <[EMAIL PROTECTED]> 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)

Yeah, it works on glibc-2.5.1.

$ ./tanh
z = (0,  1.5708), ctanh(z) = (0,1.63318e+16)
$ /lib/libc.so.6
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.22.1-2<< system on 2007-08-01.
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>.

It's possible to look around and find a patch, but it might be
difficult for glibc-2.3.6.

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to