RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v33]
fabioromano1
duke at openjdk.org
Thu Oct 10 19:47:14 UTC 2024
On Thu, 10 Oct 2024 16:12:57 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:
>> fabioromano1 has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Store log5(2) in BigDecimal
>
> src/java.base/share/classes/java/math/BigDecimal.java line 5270:
>
>> 5268: intVal = intVal.shiftRight(powsOf2); // remove powers of 2
>> 5269: // maxPowsOf5 == ceil(log5(intVal)) roughly
>> 5270: long maxPowsOf5 = (long) Math.ceil(intVal.bitLength() * LOG_5_OF_2);
>
> Please document the meaning of this variable in form of inequalities w.r.t. `intVal`.
> Also, shouldn't it be named `maxExpOf5` or similar? It's an exponent, after all.
The name `maxPowsOf5` has been chosen for consistence with `powsOf2`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21323#discussion_r1795995929
More information about the core-libs-dev
mailing list