As discussed on the mailing list:
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.
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.