bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with pow()


From: Varga Zoltan
Subject: problem with pow()
Date: Mon, 6 Oct 2003 18:38:58 +0200 (CEST)

                                  Hi All,

   I'm having some problems with the pow () function in
glibc2.3.2 on
x86. Consider the following test program:

#include <stdio.h>
#include <math.h>

void main() {
        double d;

        d = pow (-2, 1E300);
        printf ("D: %f.\n", d);

        d = pow (-2, -1E300);
        printf ("D: %f.\n", d);
}


Under x86 linux, this prints out:

D: nan.
D: nan

I think the answer should be +inf and 0, respectively. Both
solaris,
windows, and the IBM Accurate Portable Mathematical library
returns
these values, so I think this might be a bug in the assembly
language
pow routine in glib.

I wanted to report this to www-gnats.gnu.org, but it seems to be
down for some time.

                                  bye

                                        Zoltan








reply via email to

[Prev in Thread] Current Thread [Next in Thread]