This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: parameter checking
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: "Nigel Wetters" <Nigel dot Wetters at lshtm dot ac dot uk>
- Cc: <gsl-discuss at sources dot redhat dot com>
- Date: Sat, 22 Mar 2003 18:51:01 +0000
- Subject: Re: parameter checking
- References: <se7753ba.037@s-webmail.lshtm.ac.uk>
Nigel Wetters writes:
> I guess this is a question about coding style. For the past few
> days, I've been stupidly passing zero values to construct gamma
> distributrions, when the library assumed it would never be passed a
> zero value. I'm obviously at fault here, but I would have found the
> problem a lot quicker with a bit of help from the libraries.
>
> If a function expects parameters within certain bounds, should
> those parameters be checked, or is it the user's responsibility to
> check bounds before calling a function?
There is currently no error checking on the pdf functions -- see
randist/TODO. When a function returns a double there is an issue of
how to signal an error. The only option in this case is to return NaN
for invalid parameters.
--
Brian Gough
----------------------------------------------------------------------
Network Theory Ltd Phone: +44 117 3179309 (UK: 0117 3179309)
15 Royal Park Fax: +44 117 9048108 (UK: 0117 9048108)
Bristol BS8 3AL WWW: http://www.network-theory.co.uk/
United Kingdom Email: bjg at network-theory dot co dot uk
----------------------------------------------------------------------