Hello everyone.
On yesterday's contest I implemented a exponentiation function.
long long pow(long long n, long long k) {
n %= MOD;
if(k == 0) return 1;
if(k&1) return (n*(pow(n*n, k/2))%MOD)%MOD;
return pow(n*n, k/2) %MOD;
}
long long get(long long n) {
long long t = (n * pow(2, n-1));
t %= MOD;
return t;
}
Which for some reason it returning a double when the exponent is high enough.
Why could this be?