The BigDecimal.negate(MathContext) method rounds improperly in some cases. It is implemented as plus(mc).negate() i.e. to rounds before negating. This gives the improper result if the rounding mode is asymetric with respect to sign, as round to +infinity and round to -infinity are.
|