summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authormzuenni <michi.zuendorf@gmail.com>2024-01-26 15:11:13 +0100
committermzuenni <michi.zuendorf@gmail.com>2024-01-26 15:11:13 +0100
commitd6267a0a65fb90d86c692a539df8d4c11f1ec3c8 (patch)
tree70a5ae73578e9361f1de98e73882623c369fa7ca /math
parent72172d9c91afd418204caf0ca559225a608b8df1 (diff)
lll
Diffstat (limited to 'math')
-rw-r--r--math/millerRabin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/math/millerRabin.cpp b/math/millerRabin.cpp
index c6a782f..cb27d29 100644
--- a/math/millerRabin.cpp
+++ b/math/millerRabin.cpp
@@ -10,7 +10,7 @@ bool isPrime(ll n) {
ll v = powMod(a, d, n); //with mulmod or int128
if (v == 1 || v == n - 1) continue;
for (ll i = 1; i <= j; i++) {
- v = (v * v) % n; //mulmod or int128
+ v = ((lll)v * v) % n;
if (v == n - 1 || v <= 1) break;
}
if (v != n - 1) return false;