RFR: 8339934: Simplify Math.scalb(double) method [v2]

Joe Darcy darcy at openjdk.org
Fri Sep 13 19:04:05 UTC 2024


On Fri, 13 Sep 2024 18:56:35 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

> I considered using `powerOfTwoD` but it uses a `long` `+`, and performs an additional masking which seems useless or over-cautious and does not help if `n` is out of range (assuming the assert is not enabled).
> 
> What about a `private` similar method that just does the bare minimum and which could also be invoked by `powerOfTwoD`?

Sure; having a raw "powerOfTwo0" that didn't do any checks, etc. as a kernel operation sounds fine.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20948#discussion_r1759342756


More information about the core-libs-dev mailing list