rouiiii
rouiiii

Reputation: 53

Power Function for very large numbers

I need to get the result of a 16 byte number to the power of a 32 bit number:

funcResult = 16 byte number ^ 32 bit

I have tried many options, but the result is either infinity or error. And obviously regular BigInteger is no match for this. What other options do I have?

Upvotes: 0

Views: 108

Answers (1)

Ahijit
Ahijit

Reputation: 134

There isn't a variable type in Java bigger than BigInteger. Try increasing the heap size.

java -Xmx256m MyClass.java

Xmx- Max Heap Size

You may find this helpful:

https://www.rgagnon.com/javadetails/java-0131.html

Upvotes: 1

Related Questions