Skip to content

Commit cefe411

Browse files
committed
Fix typo in Miller Rabin
1 parent 5a0c53f commit cefe411

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

code/mathematics/miller_rabin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ bool is_probable_prime(ll n, int k) {
55
int s = 0; ll d = n - 1;
66
while (~d & 1) d >>= 1, s++;
77
while (k--) {
8-
ll a = uniform_int_distribution(2LL, n-1)(rng);
8+
ll a = uniform_int_distribution(2LL, n-2)(rng);
99
ll x = mod_pow(a, d, n);
1010
if (x == 1 || x == n - 1) continue;
1111
bool ok = false;

0 commit comments

Comments
 (0)