I am trying to figure out the following problem related to BigIntegers in Java 7 x64. I am trying to calculate a number to extremely high power. The code below is followed by a description of the problem.
import java.math.BigInteger; public class main { public static void main(String[] args) {
I'm having trouble printing the result of this operation. When this code executes this, it prints a message, but not the value of images.toString() .
To isolate the problem, I began to calculate the powers of the two instead of the desired calculation, listed in the comment on this line. On two systems I tested this, 2^15544 - the smallest calculation that causes the problem; 2^15543 working fine.
I donโt know where close to the memory limit on the host systems, and I donโt think that I am even close to the VM limit (in any case, with the arguments of VM -Xmx1024M -Xms1024M there is no effect).
After searching for information on the Internet, I came to the conclusion that I click on the limit in BigInteger or String associated with the maximum array size ( Integer.MAX_VALUE ) that these types use for internal data storage. If the problem is in String , I think it would be possible to extend BigInteger and write a print method that spews a few characters at a time until all BigInteger is printed, but I rather suspect the problem is in another place.
Thanks for taking the time to read my question.
Techrocket9
source share