On Wed, 18 Mar 2026 18:57:15 GMT, Daisuke Yamazaki <[email protected]> wrote:

> 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.

This pull request has now been integrated.

Changeset: d58fb1e2
Author:    Daisuke Yamazaki <[email protected]>
Committer: Raffaello Giulietti <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/d58fb1e290cb8a28a04900e132ae09002ae62937
Stats:     6 lines in 1 file changed: 1 ins; 2 del; 3 mod

8374202: Simplify significand normalization in BigDecimal(double, MathContext) 
constructor

Reviewed-by: rgiulietti

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

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

Reply via email to