You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Tim O'Brien <to...@discursive.com> on 2003/06/11 16:48:35 UTC
Re: [math] NaN vs. Exception Revisited (was: Re: [math] proposed
ordering for task list, scope of initial release)
> I think your usage of Convergence Exception is appropriate in your case.
> In your case your waiting for the method to return, if it fails to
> converge, you need to know why, there may be different reasons, and its
> an "exceptional case" which probibly terminates the whole process in the
> long run.
+1, a ConvergenceException makes sense.
> try{
> MathUtils.factorial( Math.floor( Math.log(
> StatUtils.geomean(someobj.getArray()) )))
>
> }catch(InvalidInputValueException iive){
> iive.printStackTrace(...);
> }
-1, not only is that a very bad idea in terms of usage constraints, it
tends to buck a well established trend. Complex "algorithms" should
through checked exception, something like finding an Average of a set of
values should return NaN.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [math] NaN vs. Exception Revisited
Posted by "Mark R. Diggory" <md...@latte.harvard.edu>.
Tim O'Brien wrote:
>>I think your usage of Convergence Exception is appropriate in your case.
>>In your case your waiting for the method to return, if it fails to
>>converge, you need to know why, there may be different reasons, and its
>>an "exceptional case" which probibly terminates the whole process in the
>>long run.
>>
>>
>
>+1, a ConvergenceException makes sense.
>
>
>
>>try{
>> MathUtils.factorial( Math.floor( Math.log(
>> StatUtils.geomean(someobj.getArray()) )))
>>
>>}catch(InvalidInputValueException iive){
>> iive.printStackTrace(...);
>>}
>>
>>
>
>-1, not only is that a very bad idea in terms of usage constraints, it
>tends to buck a well established trend. Complex "algorithms" should
>through checked exception, something like finding an Average of a set of
>values should return NaN.
>
>
>
Just testing the conceptual waters, if we still feel as strongly about
it, very well...
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org