1
0
mirror of https://github.com/golang/go synced 2024-09-24 15:20:16 -06:00

Fix incorrect comment variable reference.

w&1 is the parity of 'x', not of 'n'.
This commit is contained in:
Will Beason 2018-12-25 19:03:44 -06:00 committed by GitHub
parent 55e3aced9e
commit 54ba08ab10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ func (x *Int) ProbablyPrime(n int) bool {
}
if w&1 == 0 {
return false // n is even
return false // x is even
}
const primesA = 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23 * 37