[
https://issues.apache.org/jira/browse/MATH-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12929561#action_12929561
]
Luc Maisonobe commented on MATH-433:
------------------------------------
The integer versus double inconsistency is almost mandated by the language
itself. Division by 0 for integers for example does trigger a dedicated
exception whereas division by 0 for double obey the IEEE754 rules. I think it
is also the same in other languages too. In fact double arithmetic is something
very specific with many bells and whistles (signed 0, NaN, infinities,
subnormal numbers) in addition to the normal numbers. Other types have only
regulars numbers in some range and no special values.
This explains this sort of inconsistencies and many algorithms do depend on the
availability of these special values for double.
> Signal overflow by raising an exception
> ---------------------------------------
>
> Key: MATH-433
> URL: https://issues.apache.org/jira/browse/MATH-433
> Project: Commons Math
> Issue Type: Improvement
> Reporter: Gilles
> Priority: Minor
>
> Referring to the ML thread (with subject "Factorial").
> Shouldn't Commons-Math always raise an exception when overflow is detected,
> including in cases where the Java language specification has decided to
> return infinity?
> It was argued, in the ML thread on "FunctionEvaluationException", that it was
> much better to raise an exception than to rely on special values to detect
> problems. I think that the same argument fits perfectly in this case.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.