commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (Commented) (JIRA)" <>
Subject [jira] [Commented] (MATH-755) On the contract of FieldElement<T>.divide(T)
Date Sun, 26 Feb 2012 21:22:49 GMT


Gilles commented on MATH-755:

> On the contract of FieldElement<T>.divide(T)
> --------------------------------------------
>                 Key: MATH-755
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.0, 3.1
>            Reporter: S├ębastien Brisard
>            Assignee: S├ębastien Brisard
>            Priority: Minor
>              Labels: exception, field
>             Fix For: 3.1
> As discussed on the mailing list:
> {quote}
> The contract of {{FieldElement<T>.divide(T)}} states that an {{ArithmeticException}}
should be thrown if the parameter is zero. However, for this boundary case
> * {{BigFraction}} throws {{ZeroException}}
> * {{ArithmeticException}} throws {{ArithmeticException}}
> * {{Complex}} uses NaNs instead of exceptions
> * {{Dfp}}, {{DfpDec}} use flags instead of exceptions
> * {{Fraction}} throws {{MathArithmeticException}}.
> {quote}
> There is a need for some cleaning up, which will proceed in two steps
> # in version 3.0 of the {{FieldElement}} interface the statement that an exception must
be thrown will be removed. The rationale for this is that sometimes, an exception is actually
not wanted. For example, I'm using a wrapper around primitive {{double}}, and I want all boundary
cases to be handled _exactly_ the same way as the primitive operation "/").
> # in version 3.1 of Commons Math, the _same_ exception (if any) will be thrown by all
implementations. This will require to chose between {{ArithmeticException}}, {{MathArithmeticException}}
and {{ZeroException}}.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message