Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

numbertheory.h File Reference

Provides miscellaneous number theory routines. More...

#include <list>
#include "utilities/nmpi.h"

Namespaces

namespace  regina

Functions

long reducedMod (long k, long modBase)
 Reduces k modulo modBase to give the smallest possible absolute value.
unsigned long gcd (unsigned long a, unsigned long b)
 Calculates the greatest common divisor of two given integers.
long gcdWithCoeffs (long a, long b, long &u, long &v)
 Calculates the greatest common divisor of two given integers and finds the smallest coefficients with which these integers combine to give their gcd.
unsigned long modularInverse (unsigned long n, unsigned long k)
 Calculates the multiplicative inverse of one integer modulo another.
void factorise (unsigned long n, std::list< unsigned long > &factors)
 Calculates the prime factorisation of the given integer.
void primesUpTo (const NLargeInteger &roof, std::list< NLargeInteger > &primes)
 Determines all primes up to and including the given upper bound.


Detailed Description

Provides miscellaneous number theory routines.


Copyright © 1999-2004, Ben Burton
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).