[testsuite gfortran] partial fix for secnds*.f

Dominique Dhumieres dominiq@lps.ens.fr
Sat May 12 09:23:00 GMT 2007


> >I don't understand how the tests can return 86400.0!
> 
> Strange, indeed.  Though it could possibly be rounding very slightly or 
> something....

I have now reach the following conclusions:
(1) SECNDS() may return 86400.0 (I'll try to investigate the rounding 
issue),
(2) SECNDS() is not designed to handle timings outside the range
[0.0,86400.0[:

...
temp2 = fmod (*x, 86400.0);
temp2 = (temp1 - temp2 >= 0.0) ? temp2 : (temp2 - 86400.0);
return temp1 - temp2;
...

if x= 86400.0 then temp2=0.0 (assuming a "normal" behavior of fmod),
if temp1=86400.0 (same time interval) then temp1 - temp2 >= 0.0 and
temp2=0.0, then 'return temp1 - temp2' returns 86400.0 instead of 0.0!-(

My conclusion is that SECNDS() should be modified either to never return
a value outside [0.0,86400.0[ (the same for temp1) or the above three 
lines should be changed to return 0.0 instead of 86400.0.

I have also seen another glitch I have to investigate, so wait for my next 
midnight!

Dominique



More information about the Gcc-patches mailing list