RFR: 8302204: Optimize BigDecimal.divide

Raffaello Giulietti rgiulietti at openjdk.org
Thu Feb 16 18:10:28 UTC 2023


On Thu, 16 Feb 2023 16:51:43 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

> It can be shown that 5 divides `intVal` if and only if it divides the `long` sum of all `int`s in the mag array of `intVal`.

More precisely, the sum must be computed over the `mag` elements taken as _unsigned_ values:
`sum += mag[i] & 0xffff_ffffL`

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

PR: https://git.openjdk.org/jdk/pull/12509


More information about the core-libs-dev mailing list