unexpected result with gsl_sf_lngamma_e
Laura Evans
lje5@cornell.edu
Wed Dec 19 13:20:00 GMT 2001
I am working with gsl-0.9.3 and was comparing gsl_sf_lngamma_e to our
own version of this routine. Execution of gsl_sf_lngamma_e resulted
in a core dump when I executed it with a value of -1
PROBLEM: error code not returned on error branch.
The error message before the differenceAbort was as follows:
gsl:gamma.c 775: ERROR: error
I looked at /gsl-0.9.3/specfunc/gamma.c line 775, and find
775 GSL_ERROR ("error", GSL_EDOM);
An error code is not returned. The other branches return
GSL_SUCCESS .
My impression from the documentation was that I should check
the integer status field
after execution of this routine to determine whether the
routine executed successfully.
See, for example, line 52 of /gsl-0.9.3/specfunc/laguerre.c
52 int stat_lg = gsl_sf_lngamma_e(b+n, &lg_b).
Thus, the observed behavior seems to be a bug.
SUGGESTED FIX: return an error code
I have changed line 775 in my version of gamma.c, as follows:
775 return GSL_EDOM
I then receive a non-zero return code. My user application
then knows there was an
error and can handle that as required.
More information about the Gsl-discuss
mailing list