RFR: 8341402: BigDecimal's square root optimization
fabioromano1
duke at openjdk.org
Mon Oct 21 17:04:24 UTC 2024
On Mon, 21 Oct 2024 16:47:36 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:
> Since there's an invocation of `stripTrailingZeros()` anyway, what's the reason to _not_ "optimize" for other round modes as well, like in the current implementation?
Because it is not necessary to strip zeros when an exact result is not requested, so while the call to `stripTrailingZeros()` speeds up only for the unlikely case that the input is an even power of 10, it slows down for all other cases...
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21301#issuecomment-2427261831
More information about the core-libs-dev
mailing list