Regina 7.3.1 Calculation Engine
numbertheory.h File Reference

Provides miscellaneous number theory routines. More...

#include <list>
#include <tuple>
#include "regina-core.h"
#include "maths/integer.h"

Namespaces

namespace  regina
 Contains the entire Regina calculation engine.
 

Functions

long regina::reducedMod (long k, long modBase)
 Reduces k modulo modBase to give the smallest possible absolute value.
 
long regina::gcd (long a, long b)
 Deprecated routine that calculates the greatest common divisor of two signed integers.
 
std::tuple< long, long, long > regina::gcdWithCoeffs (long a, long b)
 Calculates the greatest common divisor of two given integers and finds the smallest coefficients with which these integers combine to give their gcd.
 
long regina::lcm (long a, long b)
 Deprecated routine that calculates the lowest common multiple of two signed integers.
 
unsigned long regina::modularInverse (unsigned long n, unsigned long k)
 Calculates the multiplicative inverse of one integer modulo another.
 

Detailed Description

Provides miscellaneous number theory routines.


Copyright © 1999-2025, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).