This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/403] New: exp10 gives nonsense results


Hi,

exp10 gives me always the same result for different parameters.
When I assign some variables before, the results will be
different (i.e. 1 instead of -1.996864) but still the same
for different parameters

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

int main(int argc, char **argv) {
/*    double x, y;
    x = 5;
    y = exp10(x);
    printf("exp10(x) = %f\n", y); */
    printf("exp10(-4) = %f\n", exp10(-4.));
    printf("exp10(-1) = %f\n", exp10(-1.));
    printf("exp10(0) = %f\n", exp10(0.));
    printf("exp10(1) = %f\n", exp10(1.));
    printf("exp10(2) = %f\n", exp10(2.));
    printf("exp10(4) = %f\n", exp10(4.));
    printf("exp10(8) = %f\n", exp10(8.));
    return 0;
}

Gives me:
exp10(-4) = -1.996864
exp10(-1) = -1.996864
exp10(0) = -1.996864
exp10(1) = -1.996864
exp10(2) = -1.996864
exp10(4) = -1.996864
exp10(8) = -1.996865

And with un-commented part:
exp10(x) = 1.000000
exp10(-4) = 1.000000
exp10(-1) = 1.000000
exp10(0) = 1.000000
exp10(1) = 1.000000
exp10(2) = 1.000000
exp10(4) = 1.000000
exp10(8) = 1.000000

glibc is libc-2.3.2
kernel is linux-2.4.20
gcc is 3.3 20030226 (prerelease) (SuSE Linux)

-- 
           Summary: exp10 gives nonsense results
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P3
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: fabian at fs-maphy dot uni-hannover dot de
                CC: glibc-bugs at sources dot redhat dot com
  GCC host triplet: i486-suse-linux
GCC target triplet: i686


http://sources.redhat.com/bugzilla/show_bug.cgi?id=403

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]