Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
primes.C File Reference
#include <exception>
#include <string>
#include <algorithm>
#include <ah-errors.H>
#include <primes.H>
Include dependency graph for primes.C:

Go to the source code of this file.

Namespaces

namespace  Primes
 

Functions

size_t Primes::next_prime (unsigned long n)
 Find the smallest prime number >= n from the database.
 
bool Primes::check_primes_database ()
 Verify the integrity of the prime database.
 

Variables

const unsigned long Primes::primeList []
 Pre-computed array of prime numbers for fast lookup.
 
const size_t Primes::numPrimes = sizeof(primeList) / sizeof(primeList[0])
 Number of primes in the pre-computed database.
 
const unsigned long Primes::DefaultPrime = primeList[0]
 Default prime number used when no specific size is requested.