From: Andreas K. <and...@Ac...> - 2005-10-04 15:51:16
|
> In general what should happen if a mathematical function is to be > evaluated for a set of argument for which it is not defined? > > In this case, the bug is that there is a division by zero and > this is reported as such, rather than as a clearer message > that the coefficient of variation is not defined if the mean > of the data is zero. > > My question: > - Should the function return such a (clearer) message or > - Should it return an empty string (not an error) thereby > leaving it to the caller to handle the _undefined_ > situation > > I can argue either way, but we should probably try for a > consistent practice. My personal opinion is to return a clear error message, even if that entails catching and rethrowing errors. -- Andreas Kupries <and...@Ac...> Developer @ http://www.ActiveState.com, a division of Sophos Tel: +1 604 484 6491 |