Java 8 RFR 6480539: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0")

Brian Burkhalter brian.burkhalter at
Wed Jul 3 17:47:47 UTC 2013

Hi Joe,

Thanks for pointing out the problems with modifying the private methods. I'll update this only to change the one public method and to modify its specification.



On Jul 3, 2013, at 10:35 AM, Joe Darcy wrote:

> I have some concerns with this patch.
> First, I think the stripTrailingZeros specification should explicitly call out what happens with a numerically zero value.
> Second, I would have expected the code change to be limited to the stripTrailingZeros method. The private createAndStripZerosToMatchScale methods are used during rounding operations and unconditionally set the scale of a zero value to zero, which is incorrect according to the specification.
> I believe sufficiently thorough tests of divide should fail with the current changes to createAndStripZerosToMatchScale.

More information about the core-libs-dev mailing list