This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Error Handling


Andrew Binkley writes:
 > I have read the gsl documentation and was thinking of using the
 > macro GSL_ERROR (reason, gsl_errno).  However as far as I can tell
 > this has a return type of int, and my functions have a return type
 > of gsl_complex.  Should I just return the gsl_errno in both the
 > real and imaginary components?
 > 
 > I have looked through the existing gsl/complex/math.c but can't
 > find any clues.  What is a good way to go about this?  The errors I
 > would like to signify are GSL_ERANGE (for both over and underflow)
 > and domain error.

Hi,

Try the macro GSL_ERROR_VAL() in gsl_errno.h which calls the error
handler but returns an arbitrary value.

regards,

-- 
Brian 

Network Theory Ltd            
15 Royal Park                 
Bristol BS8 3AL               
United Kingdom                

Tel: +44 (0)117 3179309 
Fax: +44 (0)117 9048108              
Web: http://www.network-theory.co.uk/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]