This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
Floating point problem on glibc-2.1.1
- To: libc-alpha@cygnus.com
- Subject: Floating point problem on glibc-2.1.1
- From: Tung-Han Hsieh <thhsieh@linux.org.tw>
- Date: Mon, 3 May 1999 21:27:12 +0800
Hello,
We discover a floating point problem on glibc-2.1.1:
#include <math.h>
#include <stdio.h>
main()
{
printf("%d\n", (int)(log(8.0)/log(2.0)));
}
When compile this simple program with command:
cc file.c -lm
and run it, the output is "2", but not "3"; while in other plateforms,
say, Solaries-2.5.1, the output is "3".
This problem also exists in glibc-2.0.7.
Best Regards,
T.H.Hsieh