reporting an error from a REAL function



How should I report an error from a REAL function whose RESULT can take
on any value? I don't want to terminate the program within the
function. If it were a subroutine, I could use one argument as an error
flag. Most of my INTEGER functions returns counts, so I can return
negative integers to signal errors.

Should I set the function RESULT to NaN and then use the Fortran 2003
function ieee_support_nan() when it becomes available in the compilers
I use? I think some compilers have an isnan() function.

.



Relevant Pages

  • Re: reporting an error from a REAL function
    ... > How should I report an error from a REAL function whose RESULT can take ... I think some compilers have an isnanfunction. ... Well, that half contradicts your statement, in that NaN is a value. ...
    (comp.lang.fortran)
  • Re: A call to automated proof verification systems
    ... > There is no general way of detecting dead code, and still compilers ... interrupt. ... it means that these programs actually never terminate. ...
    (comp.theory)
  • Re: Ada generics
    ... so it is not the language problem ... Unicode issues if it wishes to allow Unicode characters in identifiers. ... terminate, just like programs themselves have always been able to do. ... so anyway real compilers will just notice and give up. ...
    (comp.lang.ada)