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

Floating point problem on glibc-2.1.1



Package: libc6
Version: 2.1.1-1



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 on 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


Reply to: