pow « biginteger « Java Data Type Q&A





1. java.math.BigInteger pow(exponent) question    stackoverflow.com

I did some tests on pow(exponent) method. Unfortunately, my math skills are not strong enough to handle the following problem. I'm using this code:

BigInteger.valueOf(2).pow(var);
Results:
  • var | time in ms
  • 2000000 | 11450
  • 2500000 | ...

2. BigInteger.pow() with a BigInteger    stackoverflow.com

I am tying to throw an exception when a BigInteger is greater than Integer.MAX_VALUE. It will not allow me to throw that exception for the exponent case. I am not ...

3. BigInteger.pow(BigInteger)?    stackoverflow.com

I'm playing with numbers in Java, and want to see how big a number I can make. It is my understanding that BigInteger can hold a number of infinite size, so ...

4. What are complexities of BigInteger.pow and BigInteger.isProbablePrime?    stackoverflow.com

What are complexities of Java 7's methods pow and isProbablePrime in the BigInteger class? I know that simple implementation of Rabin's test is of O(k(log(n))^3) complexity ...