Re: C routines for Special Functions

From: Richard Heathfield (dontmail_at_address.co.uk.invalid)
Date: 02/03/04


Date: Tue, 3 Feb 2004 03:09:48 +0000 (UTC)


[Followups set to comp.lang.c]

Keith A. Lewis wrote:

<snip>
> Error Handling
>
> I'm not a fan of the 'int status = gsl_function(...); if (status)
> {...' method of error handling for functions that return doubles.
> I am especially not a fan of having default error handlers call
> abort(), like the assert macro in C. Of course I've had the head
> of IT tear me a new *** when a programmer of mine left an assert
> in production code that got called 15 minutes before market open,
> so I can't claim to be unbiased.

If the assertion was written properly (i.e. the condition was one that
/must/ be true if the program is correctly written), then the fault lies
not with the programmer who "left an assert in production code" but with
whoever failed to test the condition that led to the assertion being fired.

<snip>

-- 
Richard Heathfield : binary@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton

Quantcast