This is the mail archive of the libc-alpha@cygnus.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]

Floating point problem on glibc-2.1.1


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


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