RFC 6910473: BigInteger negative bit length, value range, and future prospects

Paul Sandoz paul.sandoz at oracle.com
Tue Oct 15 08:20:32 UTC 2013


Hi,

I took a look at the patch, but i am not an expert in this area.

On BigInteger:

  99  * @implNote
 100  * BigInteger constructors and operations throw {@code ArithmeticException} when
 101  * the result is out of the supported range. The supported range in JDK 8 is
 102  * -2<sup>{@code Integer.MAX_VALUE}</sup> to
 103  * 2<sup>{@code Integer.MAX_VALUE}</sup>, exclusive.

I suggest changing to:

@implNote
BigInteger constructors and operations throw {@code ArithmeticException} when
the result is out of the supported range of  -2<sup>{@code Integer.MAX_VALUE}</sup>
(exclusive) to 2<sup>{@code Integer.MAX_VALUE}</sup> (exclusive).

I don't think it is worth declaring @throws ArithmeticException for all relevant constructors and operations. This is likely to be noise for most people and the implNote is sufficient.

Paul.

On Oct 15, 2013, at 2:27 AM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:

> Ping!
> 
> This proposal could use more comments, not to mention review(s).
> 
> http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-September/021264.html
> 
> Thanks,
> 
> Brian
> 
> On Oct 3, 2013, at 5:58 PM, Brian Burkhalter wrote:
> 
>> I have reviewed this proposed change a couple of times in its current form and it looks good to me.
>> 
>> It would be good to see some comments about the general concept from BigInt cognoscenti, and from (a) Reviewer(s) as concerns the @implNote addition as well as the new ArithmeticExceptions added at several points in the javadoc. 
> 



More information about the core-libs-dev mailing list