lib/prime.c: fixed a bug where 2 was not a prime in is_prime().
This commit is contained in:
parent
f22af0ffaf
commit
428e392868
2 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,8 @@ int is_prime(uint32_t p) {
|
|||
|
||||
uint32_t i, l;
|
||||
|
||||
if (p == 2)
|
||||
return 1;
|
||||
if (p < 2 || (p & 1) == 0)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue