C++ Utilities  4.6.1
Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
Functions
MathUtilities Namespace Reference

Contains various mathematical functions. More...

Functions

CPP_UTILITIES_EXPORT int random (int lowerbounds, int upperbounds)
 Returns a pseudo random number between lowerbounds and upperbounds. More...
 
CPP_UTILITIES_EXPORT int digitsum (int number, int base=10)
 Returns the digitsum of the given number using the specified base. More...
 
CPP_UTILITIES_EXPORT int factorial (int number)
 Returns the factorial of the given number. More...
 
CPP_UTILITIES_EXPORT uint64 powerModulo (uint64 base, uint64 expontent, uint64 module)
 Computes base power exponent modulo module. More...
 
CPP_UTILITIES_EXPORT int64 inverseModulo (int64 number, int64 module)
 Computes the inverse of number modulo module. More...
 
CPP_UTILITIES_EXPORT uint64 orderModulo (uint64 number, uint64 module)
 Computes the order of number modulo module. More...
 

Detailed Description

Contains various mathematical functions.

Function Documentation

◆ digitsum()

int MathUtilities::digitsum ( int  number,
int  base = 10 
)

Returns the digitsum of the given number using the specified base.

Definition at line 24 of file math.cpp.

◆ factorial()

int MathUtilities::factorial ( int  number)

Returns the factorial of the given number.

Definition at line 37 of file math.cpp.

◆ inverseModulo()

CPP_UTILITIES_EXPORT int64 MathUtilities::inverseModulo ( int64  number,
int64  module 
)

Computes the inverse of number modulo module.

Definition at line 67 of file math.cpp.

◆ orderModulo()

CPP_UTILITIES_EXPORT uint64 MathUtilities::orderModulo ( uint64  number,
uint64  module 
)

Computes the order of number modulo module.

Definition at line 84 of file math.cpp.

◆ powerModulo()

CPP_UTILITIES_EXPORT uint64 MathUtilities::powerModulo ( uint64  base,
uint64  expontent,
uint64  module 
)

Computes base power exponent modulo module.

Definition at line 49 of file math.cpp.

◆ random()

int MathUtilities::random ( int  lowerbounds,
int  upperbounds 
)

Returns a pseudo random number between lowerbounds and upperbounds.

Remarks
Might be removed since std::uniform_int_distribution does the same.

Definition at line 15 of file math.cpp.