Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#505 CHECK_MATH does not always clear errors

closed-fixed
nobody
None
5
2012-12-20
2012-12-19
Kalith
No

The following code shows a problematic behavior of CHECK_MATH :
print,check_math()
n=[-1.0, 1.0]
d=[1.0, 0.0]
a=alog10(n/d)
print,check_math()
print,check_math()
print,check_math()

end

The problem is that two errors are reported : first a code 128 for the log of negative value, then a code 16 for the floating point divide by zero. GDL prints :
0
16
128
0
while IDL prints :
0
144
0
0

This is very problematic, since the Astrolib function TRAPZD (used by QSIMP, hence by LUMDIST) makes use of these error flags to spot ill-defined functions before integrating. In order not to be influenced by previous errors in the code, it makes a single dummy call to CHECK_MATH to clear everything, but that is not sufficient because of this bug. Thus, depending on the error context in which LUMDIST is called, it either works or doesn't.

Discussion

  • Marc Schellens
    Marc Schellens
    2012-12-20

    Thanks for the report.

     
  • Marc Schellens
    Marc Schellens
    2012-12-20

    • status: open --> closed-fixed