RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v44]

fabioromano1 duke at openjdk.org
Mon Oct 14 15:28:15 UTC 2024


On Mon, 14 Oct 2024 15:16:49 GMT, fabioromano1 <duke at openjdk.org> wrote:

>> src/java.base/share/classes/java/math/BigDecimal.java line 5280:
>> 
>>> 5278:         BigInteger[] qr; // quotient-remainder pair
>>> 5279:         // Remove 5^(2^i) from the factors of intVal, until 5^remainingZeros < 5^(2^i)
>>> 5280:         // (i.e., there are too few powers of five left to remove).
>> 
>> It's a bit unclear what's meant here with "_too few_ powers of five left to remove".
>> Can we have something more explicit?
>
> It's hard for me to think of something more explicit than the mathematical definitions already present in the comments...

Maybe something like "too few powers of five left to remove with respect to the maximum number of removable zeros in the original value of intVal", I can't think of anything better for now...

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21323#discussion_r1799717603


More information about the core-libs-dev mailing list