test for the MOD() intrinsic

Paul Thomas paulthomas2@wanadoo.fr
Tue Nov 29 05:54:00 GMT 2005


Uttam, Richard, Brooks ....

>According to f95, the second parameter can be 0 (zero), and if that is
>the case then the result is processor dependent. While, f2003 says, the
>second parameter can not be zero. gfortran (mainline) treats it
>according to f2003 std. It emit errors if the second parameter is zero.
>
>  
>
There is a TODO comment in trans-intrinsic.c concerning mod (x, 0.0).  I 
am some days (realistically a week!) away from submitting a patch for 
MOD that causes the function to emit NaN in this case.  I could have it 
emit a runtime error message too.  Thus, the standard dependent 
behaviour that Richard has gleaned is possible.

Paul



More information about the Fortran mailing list