doubts
muench@math.fu-berlin.de
muench@math.fu-berlin.de
Fri Feb 11 07:46:00 GMT 2000
Hi,
I don't know if your are responsible for the behaviour of functions
included in tg_math.h, like floor. We use ecgs-1.1.2 and possible
you have fixed that, than excuse me.
This mail should be an response of some users from gcc.
What we program is:
x = 5.05/0.01;
y = floor(x);
printf("x=%20.10e, floor(x)=%e \n", x, y);
x = 5.06/0.01;
y = floor(x);
printf("x=%25.16e, floor(x)=%e \n", x, y);
x= 5.0500000000e+02, floor(x)=5.050000e+02
x= 5.0599999999999994e+02, floor(x)=5.050000e+02
x= 5.0500000000e+02, floor(x)=5.050000e+02
x= 5.0599999999999994e+02, floor(x)=5.050000e+02
Now floor compute right from mathematical point of view,
The next value to 5.0599999999999994e+02 is 5.05. But
in our opinion it isn't in programmers responsibility to
control the storage values. The function must control
such numerical errors by itself, perhaps by using DBL_EPSILON
or something else. With that current behaviour it is
unsecure to use the provided functions of math.h and it isn't
friendly to users.
The only way to beware of such problems is programm much function
as possible by myself an spend no much trust too gcc functions.
That can not be the right way.
Greeting
Matthias
--
Matthias Münch
FU-Berlin, Fachbereich Mathematik und Informatik
Raum 012, Arnimallee 3, 14195 Berlin
Tel.: (030) 838 - 75-375
Fax.: (030) 838 - 75-403
e-mail: muench@math.fu-berlin.de
More information about the Gcc-bugs
mailing list