This class generates a table of prime numbers, up to the limit of an int. More...
#include "primeNumberGenerator.h"
Public Member Functions | |
int | operator [] (int n) |
Returns the nth prime number. More... | |
This class generates a table of prime numbers, up to the limit of an int.
For a given integer n, it will return the nth prime number. This will involve a recompute step only if n is greater than any previous n.
Definition at line 33 of file primeNumberGenerator.h.
int PrimeNumberGenerator::operator [] | ( | int | n | ) |
Returns the nth prime number.
this[0] returns 2, this[1] returns 3; successively larger values of n return larger prime numbers, up to the largest prime number that can be represented in an int.
Definition at line 31 of file primeNumberGenerator.cxx.