This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
[suggestion] for gsl_sf_Ci_e (in specfunc/sinint.c)
- To: gsl-discuss at sources dot redhat dot com
- Subject: [suggestion] for gsl_sf_Ci_e (in specfunc/sinint.c)
- From: Arvid Requate <arvid at Physik dot Uni-Bielefeld dot DE>
- Date: Tue, 29 May 2001 13:12:22 +0200
Hello,
while using the special function routine gsl_sf_Ci_e, I noticed
that given an argument of zero it aborts with an error, while mathematically it
should simply return zero.
Kind regards
Arvid Requate
Diff against current CVS Version:
-----------8<--------------------8<------------------------8<-------------------
*** specfunc-old/sinint.c Tue May 29 13:02:36 2001
--- specfunc/sinint.c Tue May 29 13:09:52 2001
***************
*** 354,363 ****
{
/* CHECK_POINTER(result) */
! if(x <= 0.0) {
result->val = 0.0;
result->err = 0.0;
GSL_ERROR ("error", GSL_EDOM);
}
else if(x <= 4.0) {
const double lx = log(x);
--- 354,368 ----
{
/* CHECK_POINTER(result) */
! if(x < 0.0) {
result->val = 0.0;
result->err = 0.0;
GSL_ERROR ("error", GSL_EDOM);
+ }
+ else if(x == 0.0) {
+ result->val = 0.0;
+ result->err = 0.0;
+ return GSL_SUCCESS;
}
else if(x <= 4.0) {
const double lx = log(x);
-----------8<--------------------8<------------------------8<-------------------