My Project
Loading...
Searching...
No Matches
Functions
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.

62{
63 if (p == 0) return 0;
64 else if (p == 1) return 1/*1*/;
65 else if ((p == 2)||(p==3)) return p;
66 else if (p < 0) return 2; //(iiIsPrime0((unsigned)(-p)));
67 else if ((p & 1)==0) return iiIsPrime0((unsigned)(p-1));
68 return iiIsPrime0((unsigned)(p));
69}
int p
Definition: cfModGcd.cc:4078
static int iiIsPrime0(unsigned p)
Definition: prime.cc:12