JavaMoney / jsr354-api

JSR 354 - Money and Currency API
http://javamoney.org
Apache License 2.0
357 stars 79 forks source link

Fix imprecise division functions in BigDecimalAmount. #2

Closed clanie closed 11 years ago

clanie commented 11 years ago

BigDecimalAmount.divideAndRemainder(MonetaryAmount) and divideToIntegralValue(MonetaryAmount) both unnecessary convert the divisor from BigDecimal to double and back again, potentially loosing some precision. The 1st commit adds tests showing this. The 2nd fixes it.