Orthogonal Array Library  1.0.0
Libray for generating orthogonal arrays based on Art Owen's oa library
All Classes Namespaces Files Functions Variables Typedefs Macros Pages
oacpp::primes Namespace Reference

Utilities related to prime numbers. More...

Functions

int isprime_old (int p)
 Is the number prime. More...
 
int isprime (unsigned int n)
 returns 1 for prime argument More...
 
void primepow (int q, int *p, int *n, int *isit)
 find q=p^n if q is a prime power with n>0 More...
 
int isprimepow (int q)
 returns 1 for prime power argument More...
 
int ipow (int a, int b)
 pow() with integer arguments and value More...
 

Detailed Description

Utilities related to prime numbers.

Function Documentation

◆ ipow()

int oacpp::primes::ipow ( int  a,
int  b 
)

pow() with integer arguments and value

Parameters
a
b
Returns

◆ isprime()

int oacpp::primes::isprime ( unsigned int  n)

returns 1 for prime argument

Parameters
nnumber to test
Returns
1 if p is prime

◆ isprime_old()

int oacpp::primes::isprime_old ( int  p)

Is the number prime.

Deprecated:
Deprecated due to slowness
Parameters
pnumber
Returns
1 if prime, 0 otherwise

◆ isprimepow()

int oacpp::primes::isprimepow ( int  q)

returns 1 for prime power argument

Parameters
q
Returns

◆ primepow()

void oacpp::primes::primepow ( int  q,
int *  p,
int *  n,
int *  isit 
)

find q=p^n if q is a prime power with n>0

Parameters
qinteger that is a prime power
pthe prime base
nthe integer power
isitan indicator of completion