Recent changes to 505: CHECK_MATH does not always clear errorshttps://sourceforge.net/p/gnudatalanguage/bugs/505/Recent changes to 505: CHECK_MATH does not always clear errorsenWed, 19 Dec 2012 13:57:49 -0000CHECK_MATH does not always clear errorshttps://sourceforge.net/p/gnudatalanguage/bugs/505/<div class="markdown_content"><p>The following code shows a problematic behavior of CHECK_MATH :<br />
print,check_math()<br />
n=[-1.0, 1.0]<br />
d=[1.0, 0.0]<br />
a=alog10(n/d)<br />
print,check_math()<br />
print,check_math()<br />
print,check_math()</p>
<p>end</p>
<p>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 :<br />
0<br />
16<br />
128<br />
0<br />
while IDL prints :<br />
0<br />
144<br />
0<br />
0</p>
<p>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.</p></div>KalithWed, 19 Dec 2012 13:57:49 -0000https://sourceforge.netb70a0ba53a919828c43163a7e210c2e2403085be