Loading...
Searching...
No Matches
prime.h File Reference

Go to the source code of this file.

## Functions

int | IsPrime (int p)

## Function Documentation

## IsPrime()

int IsPrime | ( | int | p | ) |

Definition at line 61 of file prime.cc.

{
if (p == 0) return 0;
else if (p == 1) return 1/*1*/;
else if ((p == 2)||(p==3)) return p;
else if (p < 0) return 2; //(iiIsPrime0((unsigned)(-p)));
else if ((p & 1)==0) return iiIsPrime0((unsigned)(p-1));
return iiIsPrime0((unsigned)(p));
}
p
int p
Definition cfModGcd.cc:4086
iiIsPrime0
static int iiIsPrime0(unsigned p)
Definition prime.cc:12