Skip to content

Commit

Permalink
Fix typo in Miller Rabin
Browse files Browse the repository at this point in the history
  • Loading branch information
SuprDewd committed Jan 12, 2025
1 parent 5a0c53f commit cefe411
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/mathematics/miller_rabin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bool is_probable_prime(ll n, int k) {
int s = 0; ll d = n - 1;
while (~d & 1) d >>= 1, s++;
while (k--) {
ll a = uniform_int_distribution(2LL, n-1)(rng);
ll a = uniform_int_distribution(2LL, n-2)(rng);
ll x = mod_pow(a, d, n);
if (x == 1 || x == n - 1) continue;
bool ok = false;
Expand Down

0 comments on commit cefe411

Please sign in to comment.