I can't figure out why the calculation of the mod not going right,
I have a=23
, b=86609
, c=17
where (d=a^c mod b
). So the result should be 16559 according to the calculator
but I get 49432?
public class Mod {
public static void main(String[] args) {
int a=23;
int b=86609;
int c=17;
double d= (Math.pow(a,c)%b);
System.out.print(d);
}
}