Replace loop-based normalisation with `Long.numberOfTrailingZeros` in 
`BigDecimal(double, MathContext)` constructor.

Compute the number of trailing(rightmost) zero bits  in the significand and 
perform a single shift,
instead of repeated shifting in a loop.
This preserves behaviour and improves performance.

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

Commit messages:
 - 8374202: Use Long.numberOfTrailingZeros for normalisation in 
BigDecimal(double, MathContext)

Changes: https://git.openjdk.org/jdk/pull/30303/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=30303&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8374202
  Stats: 6 lines in 1 file changed: 1 ins; 2 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/30303.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30303/head:pull/30303

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

Reply via email to