commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard (Resolved) (JIRA) <>
Subject [jira] [Resolved] (MATH-755) On the contract of FieldElement<T>.divide(T)
Date Wed, 28 Mar 2012 04:10:43 GMT


Sébastien Brisard resolved MATH-755.

    Resolution: Fixed

Actually fixed prior to the release of 3.0.
> 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}}
> * {{BigReal}} 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 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 "/").
> # 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