Skip to content

Drop requirement for ArithmeticException on non-terminating decimal expansion #98

@marschall

Description

@marschall

All three divide methods on MonetaryAmount (MonetaryAmount#divide(double), MonetaryAmount#divide(long), MonetaryAmount#divide(Number)) currently require

Throws:
ArithmeticException - if the exact quotient does not have a terminating decimal expansion

We have a MonetaryAmount implementation that is based on a fraction that can handle numbers that do not have a terminating decimal expansion. Strictly the specification requires us to throw a ArithmeticException even though we can handle the result.

If possible we would like to see this requirement removed. We believe the already existing requirement

Throws:
ArithmeticException - ... or if the result exceeds the numeric capabilities of this implementation class

Is enough to cause implementations that can not handle numbers that do not have a terminating decimal expansion to throw a ArithmeticException.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions