se, so the base is not squared like in
> the current implementation, and this permits to save about half of the memory.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Throw away unsignedIntPow(int, int)
-
Changes:
- all
se, so the base is not squared like in
> the current implementation, and this permits to save about half of the memory.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Use BigInteger(long, int) constructor
-
se, so the base is not squared like in
> the current implementation, and this permits to save about half of the memory.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Optimized BigInteger.pow(int) to support unsigned long bases
--
On Sat, 26 Apr 2025 19:24:21 GMT, fabioromano1 wrote:
> It seems your new `unsignedIntPow` already covers `base.mag.length == 1` case
> - your `unsignedLongPow` and `unsignedIntPow` are otherwise identical. Can we
> just remove this long shortcut and `unsignedLongPow` and use
se, so the base is not squared like in
> the current implementation, and this permits to save about half of the memory.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Put power's computation in a stand-alone method
On Sat, 26 Apr 2025 19:16:14 GMT, Chen Liang wrote:
> It seems your new `unsignedIntPow` already covers `base.mag.length == 1` case
> - your `unsignedLongPow` and `unsignedIntPow` are otherwise identical. Can we
> just remove this long shortcut and `unsignedLongPow` and use the newly
> establi
On Sat, 26 Apr 2025 17:22:09 GMT, Chen Liang wrote:
>> src/java.base/share/classes/java/math/BigInteger.java line 2721:
>>
>>> 2719: if (!pow.equals(ONE)) {
>>> 2720: for (int i = 0; i < blockLen; i++)
>>> 2721: pow = pow.multiply(pow);
>>
>> Majo
se, so the base is not squared like in
> the current implementation, and this permits to save about half of the memory.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Removed method used by nth-root
-
Changes:
- all
se, so the base is not squared like in
> the current implementation, and this permits to save about half of the memory.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Moved nth-root implementation to a dependent PR
-
This PR implements nth root computation for BigIntegers using Newton method.
This PR is dependent by this [PR](https://github.com/openjdk/jdk/pull/24690).
-
Commit messages:
- Merge branch 'openjdk:master' into BigInteger-nth-root
- Optimized nth root iteration loop
- Systematizat
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
fabioromano1 has updated the pull request with a new target base due to a merge
or a rebase. The incremental webrev excludes the unrelated changes brought in
On Thu, 24 Apr 2025 18:17:38 GMT, Raffaello Giulietti
wrote:
> * Performance enhancements in `pow()`, which is of general interest and does
> not require submitting a [CSR](https://wiki.openjdk.org/display/csr/Main).
@rgiulietti Yes, but here, the primary enhancement in `pow()` is not concerne
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
On Mon, 21 Apr 2025 10:14:05 GMT, Andrew Haley wrote:
> That's very nice. It would be even nicer if this was a permalink into the JDK
> repo, and a reference in the source code.
@theRealAph Ok. It would be useful to have a link to an explanation on how this
can be done, if there is one. Thanks
On Mon, 21 Apr 2025 10:05:21 GMT, Andrew Haley wrote:
>> fabioromano1 has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Code simplification
>
> src/java.base/share/classes/java/math/MutableBigInte
On Sun, 20 Apr 2025 05:12:19 GMT, Chen Liang wrote:
>> fabioromano1 has updated the pull request with a new target base due to a
>> merge or a rebase. The incremental webrev excludes the unrelated changes
>> brought in by the merge/rebase. The pull request contains 21 addi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
On Wed, 16 Apr 2025 22:05:34 GMT, fabioromano1 wrote:
>> This PR implements nth root computation for `BigInteger`s using Newton
>> method and optimizes `BigInteger.pow(int)` method.
>> [Here is a proof of convergence of the recurrence
>> used.](https://github.co
> This PR implements nth root computation for `BigInteger`s using Newton method
> and optimizes `BigInteger.pow(int)` method.
> [Here is a proof of convergence of the recurrence
> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf)
fabi
This PR implements nth root computation for `BigInteger`s using Newton method
and optimizes `BigInteger.pow(int)` method.
-
Commit messages:
- Remove trailing whitespaces
- Merge branch 'openjdk:master' into BigInteger-nth-root
- Add nthRoot(int) methods and optimize pow(int)
Cha
On Wed, 2 Oct 2024 10:31:09 GMT, fabioromano1 wrote:
> After changing `BigInteger.sqrt()` algorithm, this can be also used to speed
> up `BigDecimal.sqrt()` implementation. Here is how I made it.
>
> The main steps of the algorithm are as follows:
> first argument reduce
On Wed, 4 Dec 2024 14:56:02 GMT, fabioromano1 wrote:
>> After changing `BigInteger.sqrt()` algorithm, this can be also used to speed
>> up `BigDecimal.sqrt()` implementation. Here is how I made it.
>>
>> The main steps of the algorithm are as follows:
>> first a
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request with a new target base due to a merge
or a rebase. The incremental webrev excludes the unrelated changes brought in
by the merge/rebase. The pull request c
On Mon, 10 Feb 2025 09:17:51 GMT, Per Minborg wrote:
>> fabioromano1 has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> An optimization
>
> This PR seems to be targeting performance, yet no benchmarks are pro
On Wed, 4 Dec 2024 14:56:02 GMT, fabioromano1 wrote:
>> After changing `BigInteger.sqrt()` algorithm, this can be also used to speed
>> up `BigDecimal.sqrt()` implementation. Here is how I made it.
>>
>> The main steps of the algorithm are as follows:
>> first a
On Wed, 4 Dec 2024 14:56:02 GMT, fabioromano1 wrote:
>> After changing `BigInteger.sqrt()` algorithm, this can be also used to speed
>> up `BigDecimal.sqrt()` implementation. Here is how I made it.
>>
>> The main steps of the algorithm are as follows:
>> first a
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
An optimization
-
Changes:
- all: https://git.openjdk.org/jdk/pull/21301/fi
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Refine documentation
-
Changes:
- all: https://git.openjdk.org/jdk/pull/213
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Speed up computation of bitLength()
-
Changes:
- all: https://git.op
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
An optimization
-
Changes:
- all: https://git.openjdk.org/jdk/pull/21301/fi
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Optimization for integer BigDecimals detection
-
Changes:
- all: https:/
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Make digitLengthLower() static
-
Changes:
- all: https://git.op
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Optimized integer BigDecimals detection
-
Changes:
- all: https://git.op
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Added test for scale overflow
-
Changes:
- all: https://git.op
On Tue, 26 Nov 2024 17:22:41 GMT, Raffaello Giulietti
wrote:
> I don't get your point. Here's an example:
>
> ```
> BigDecimal.ONE.sqrt(new MathContext(2_000_000_000, RoundingMode.UP))
> | Exception java.lang.ArithmeticException: Overflow
> |at BigDecimal.sqrt (BigDecimal.java:2226)
>
On Tue, 26 Nov 2024 17:04:49 GMT, fabioromano1 wrote:
>> OK.
>> But for the sake of completeness, I would add at least one test case for an
>> overflowing `workingScale`.
>>
>> Other than that, the PR is then in good shape for approval.
>
>> OK. But for t
On Tue, 26 Nov 2024 15:02:20 GMT, Raffaello Giulietti
wrote:
> OK. But for the sake of completeness, I would add at least one test case for
> an overflowing `workingScale`.
I'm afraid it's not possible to produce such a test case, with the current
implementation of `BigInteger`.
Indeed, `work
On Tue, 26 Nov 2024 14:08:23 GMT, Raffaello Giulietti
wrote:
>> fabioromano1 has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Added tests for exact results path
>
> test/jdk/java/math/BigDecimal/SquareRoot
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Added tests for exact results path
-
Changes:
- all: https://git.op
On Fri, 22 Nov 2024 14:21:50 GMT, Raffaello Giulietti
wrote:
> Not sure if you are planning to make other code changes before adding the
> tests? From my perspective, the current status of the code looks good.
No, I'm not planning to make other changes, I will add the tests soon.
On Tue, 19 Nov 2024 09:21:08 GMT, Raffaello Giulietti
wrote:
> While you are at it, it would be useful to add one test for each of the paths
> in the new algorithm (including the exception cases) in the existing
> [SquareRootTests](https://github.com/openjdk/jdk/blob/master/test/jdk/java/math/
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Code simplification
-
Changes:
- all: https://git.openjdk.org/jdk/pull/213
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Code simplifications
-
Changes:
- all: https://git.openjdk.org/jdk/pull/213
On Tue, 19 Nov 2024 18:43:46 GMT, Raffaello Giulietti
wrote:
>> fabioromano1 has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Correct remainder checking
>
> src/java.base/share/classes/java/math/BigDeci
On Tue, 19 Nov 2024 18:44:27 GMT, Raffaello Giulietti
wrote:
>> fabioromano1 has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Correct remainder checking
>
> src/java.base/share/classes/java/math/BigDeci
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Correct remainder checking
-
Changes:
- all: https://git.op
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Optimization for non-zero remainder checking
-
Changes:
- all: https:/
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request with a new target base due to a merge
or a rebase. The incremental webrev excludes the unrelated changes brought in
by the merge/rebase. The pull request c
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Optimize sqrt branch for exact results
-
Changes:
- all: https://git.op
On Fri, 15 Nov 2024 13:22:32 GMT, Raffaello Giulietti
wrote:
>> fabioromano1 has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Code simplification
>
> src/java.base/share/classes/java/math/BigDeci
t;>
>> 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...
>
> @
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Code simplification
-
Changes:
- all: https://git.openjdk.org/jdk/pull/213
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Refine documentation
-
Changes:
- all: https://git.openjdk.org/jdk/pull/213
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Refine documentation
-
Changes:
- all: https://git.openjdk.org/jdk/pull/213
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Avoid overflow
-
Changes:
- all: https://git.openjdk.org/jdk/pull/21301/fi
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
adjust to preferred scale in each branch for speed
-
Changes:
- all: https:/
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Increment the unscaled sqrt for speed and round the result
-
Changes:
- all:
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Ensure no increase of precision in 99...9+1 cases
-
Changes:
- all: https:/
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Do round up with ulp in the final result
Do round up with ulp in the final res
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with two additional
commits since the last revision:
- Removed unused variable
- Ensure the result does not exceed the requested precision
On Mon, 21 Oct 2024 16:47:36 GMT, Raffaello Giulietti
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 re
On Thu, 3 Oct 2024 00:47:23 GMT, Joe Darcy wrote:
> My initial question is what additional regression test cases should be added
> to probe the new code.
@rgiulietti @jddarcy This should be the path tree for the test cases of the
algorithm, whether `signum == 1`:
If `mc.roundingMode == Roundi
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Removed trailing whitespaces
-
Changes:
- all: https://git.op
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Compute sqrt remainder only if needed to round
-
Changes:
- all: https:/
exponent range and perform any adjustment
> to get the preferred scale in the representation.
fabioromano1 has updated the pull request with a new target base due to a merge
or a rebase. The incremental webrev excludes the unrelated changes brought in
by the merge/rebase. The pull request co
On Thu, 3 Oct 2024 12:29:44 GMT, fabioromano1 wrote:
> An optimized algorithm for `BigDecimal.stripTrailingZeros()` that uses
> repeated squares trick.
This pull request has now been integrated.
Changeset: 27ef6c9d
Author:fabioromano1 <51378941+fabioroma...@users.noreply.g
> An optimized algorithm for `BigDecimal.stripTrailingZeros()` that uses
> repeated squares trick.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Refine comments to point out the substructure of the method's cont
On Thu, 17 Oct 2024 15:19:52 GMT, fabioromano1 wrote:
>> Will approve at the beginning of next week to let you add some last minute
>> (not substantial) changes during the next few days.
>
>> In any reduction approach, you still need to prove that the reduced problem
&g
On Thu, 17 Oct 2024 15:17:38 GMT, Raffaello Giulietti
wrote:
>> With the definition remainingZeros = scale - preferredScale, the proof above
>> could be adapted almost on the fly to the old implementation.
>>
>> In any reduction approach, you still need to prove that the reduced problem
>> is
On Thu, 17 Oct 2024 14:29:36 GMT, Raffaello Giulietti
wrote:
>>> The comments are OK. However, there seems to be no explicit relation
>>> between the "running" vars used in the reasoning and the expected outcome.
>>>
>>> To clarify what I mean, let v0, z0 and s0 be the initial values at method
On Thu, 17 Oct 2024 12:38:29 GMT, Raffaello Giulietti
wrote:
> The comments are OK. However, there seems to be no explicit relation between
> the "running" vars used in the reasoning and the expected outcome.
>
> To clarify what I mean, let v0, z0 and s0 be the initial values at method
> entr
> An optimized algorithm for `BigDecimal.stripTrailingZeros()` that uses
> repeated squares trick.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Refining the loop invariant for more clear proof
-
Changes:
On Tue, 15 Oct 2024 09:18:59 GMT, fabioromano1 wrote:
>> Anyway, if you find a nice proof please add it to the comments. The
>> algorithm is quite sophisticated, so it needs one.
>
> I would say yes... The invariant `i == max{n : 5^(2^n) <= 5^remainingZeros}`
> should b
1 - 100 of 378 matches
Mail list logo