Panda3D
Public Member Functions | List of all members
PrimeNumberGenerator Class Reference

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...
 

Detailed Description

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.

Member Function Documentation

◆ operator []()

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.


The documentation for this class was generated from the following files: