import java.math.BigInteger;
public class GaayuProbOne {
static void power(int N, int P) {
BigInteger result = new BigInteger("10");
BigInteger res = result.pow(P);
System.out.println(res);
}
static double power1(int N, int P) {
double res =Math.pow(N,P);
return res;
}
public static void main(String[] args) {
int N = 10;
double P = 25*power1(10,25);
System.out.println(P);
int q = (int) P;
power(N, q);
}
}
This code is to calculate 10251025 program in java.
How to calculate it?
Exception in thread "main" java. lang. Arithmetic Exception: Big Integer would overflow supported range
Is there any method to calculate 10251025 in a java program?