RFR: 8366017: Extend the set of inputs handled by fast paths in FloatingDecimal
Raffaello Giulietti
rgiulietti at openjdk.org
Tue Oct 14 17:57:08 UTC 2025
On Thu, 28 Aug 2025 15:24:21 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:
> Yet another step in modernizing `FloatingDecimal`s floating-point parsing.
Parsing proper has been the topic of a [previous PR](https://github.com/openjdk/jdk/pull/22737
). However, the mathematical conversion from the decimal representation itself still relied on existing code.
The plan is to rework the conversion algorithms and end up with a 3 tiers schema.
* The 1st tier implements some simple, efficient fast paths. They apply to a large number of simple decimals, like `1.2345` or `2.3456e-9` (see the code for the details).
* The 2nd tier will implement some more involved fast paths with higher precision arithmetic. The hope is to be able to convert most decimals produced by `Double.toString(double)` in just the 1st or 2nd tier.
* The 3rd is the fall back tier, using full precision arithmetic for long decimals. This tier will undergo a rehaul, reducing its complexity, and relying on `[Mutable]BigInteger` rather than `FDBigInteger`.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26990#issuecomment-3234043827
More information about the core-libs-dev
mailing list