> A faster and simpler way to generate random BigIntegers, avoiding eventually
> trimming of leading zeros in magnitude array.
fabioromano1 has updated the pull request incrementally with one additional
commit since the last revision:
Update BigInteger(int, Random)
Update a comment
On Mon, 27 Nov 2023 22:52:36 GMT, fabioromano1 wrote:
>> src/java.base/share/classes/java/math/BigInteger.java line 754:
>>
>>> 752: // numInts >= 1, since numBits > 0
>>> 753:
>>> 754: int firstInt = rnd.nextInt() & (-1 >>> -numBits); // Mask out
>>> any excess bits
>>
>> Ins
On Tue, 28 Nov 2023 01:08:43 GMT, Brian Burkhalter wrote:
>> It's equivalent. If you watch the implementations of other methods in the
>> class where a mask out is made, this method is often used.
>
> Indeed it looks as if that is correct.
As specified in
https://docs.oracle.com/javase/specs/j
On Tue, 28 Nov 2023 11:46:10 GMT, fabioromano1 wrote:
>> Indeed it looks as if that is correct.
>
> As specified in
> https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.19:
> "If the promoted type of the left-hand operand is int, then only the five
> lowest-order bits of the
On Mon, 27 Nov 2023 22:58:17 GMT, fabioromano1 wrote:
>> A faster and simpler way to generate random BigIntegers, avoiding eventually
>> trimming of leading zeros in magnitude array.
>
> fabioromano1 has updated the pull request incrementally with one additional
> commit since the last revision
On Mon, 27 Nov 2023 22:58:17 GMT, fabioromano1 wrote:
>> A faster and simpler way to generate random BigIntegers, avoiding eventually
>> trimming of leading zeros in magnitude array.
>
> fabioromano1 has updated the pull request incrementally with one additional
> commit since the last revision
On Tue, 28 Nov 2023 18:11:25 GMT, Brian Burkhalter wrote:
>> fabioromano1 has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Update BigInteger(int, Random)
>>
>> Update a comment
>
> Do you have any actual benchmark measurements that y
On Tue, 28 Nov 2023 19:31:14 GMT, Brian Burkhalter wrote:
>> Do you have any actual benchmark measurements that you could share?
>
>> @bplb I have not yet made benchmark measurements, but I can produce them.
>
> @fabioromano1 I think it would be good to measure and report the benefit, if
> you
On Tue, 28 Nov 2023 19:31:14 GMT, Brian Burkhalter wrote:
>> Do you have any actual benchmark measurements that you could share?
>
>> @bplb I have not yet made benchmark measurements, but I can produce them.
>
> @fabioromano1 I think it would be good to measure and report the benefit, if
> you
On Mon, 27 Nov 2023 22:58:17 GMT, fabioromano1 wrote:
>> A faster and simpler way to generate random BigIntegers, avoiding eventually
>> trimming of leading zeros in magnitude array.
>
> fabioromano1 has updated the pull request incrementally with one additional
> commit since the last revision
On Thu, 30 Nov 2023 20:37:37 GMT, Roger Riggs wrote:
>> fabioromano1 has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Update BigInteger(int, Random)
>>
>> Update a comment
>
> There are some JMH tests for BigInteger in
> test/micro/
11 matches
Mail list logo