aboutsummaryrefslogtreecommitdiff
path: root/Math
diff options
context:
space:
mode:
authorTa180m2020-06-15 10:26:56 -0500
committerTa180m2020-06-15 10:26:56 -0500
commitf25ac89ddafe14868683361bc1861aaa1fc116ff (patch)
treeade302116bf70ba6a04315fd3afade0fc62117cf /Math
parent6cc7940d64234fc361629a5e1578c23a5c46266d (diff)
update
Diffstat (limited to 'Math')
-rw-r--r--Math/numtheory.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Math/numtheory.cpp b/Math/numtheory.cpp
index 21444a2..3fd6111 100644
--- a/Math/numtheory.cpp
+++ b/Math/numtheory.cpp
@@ -6,8 +6,7 @@ int pw(int base, int exp) {
int res = 1;
while (exp) {
if (exp & 1) res = (ll)base * res % MOD;
- exp >>= 1;
- base = (ll)base * base % MOD;
+ exp >>= 1, base = (ll)base * base % MOD;
}
return res;
}