C++ Utilities  4.9.2
Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
math.h
Go to the documentation of this file.
1 #ifndef MATHUTILITIES_H
2 #define MATHUTILITIES_H
3 
4 #include "../conversion/types.h"
5 #include "../global.h"
6 
7 namespace MathUtilities {
8 
9 CPP_UTILITIES_EXPORT int random(int lowerbounds, int upperbounds);
10 CPP_UTILITIES_EXPORT int digitsum(int number, int base = 10);
11 CPP_UTILITIES_EXPORT int factorial(int number);
15 }
16 
17 #endif // MATHUTILITIES_H
CPP_UTILITIES_EXPORT int factorial(int number)
Returns the factorial of the given number.
Definition: math.cpp:39
CPP_UTILITIES_EXPORT uint64 orderModulo(uint64 number, uint64 module)
Computes the order of number modulo module.
Definition: math.cpp:86
std::int64_t int64
signed 64-bit integer
Definition: types.h:29
CPP_UTILITIES_EXPORT int64 inverseModulo(int64 number, int64 module)
Computes the inverse of number modulo module.
Definition: math.cpp:69
Contains various mathematical functions.
Definition: math.h:7
std::uint64_t uint64
unsigned 64-bit integer
Definition: types.h:49
CPP_UTILITIES_EXPORT int random(int lowerbounds, int upperbounds)
Returns a pseudo random number between lowerbounds and upperbounds.
Definition: math.cpp:17
CPP_UTILITIES_EXPORT int digitsum(int number, int base=10)
Returns the digitsum of the given number using the specified base.
Definition: math.cpp:26
CPP_UTILITIES_EXPORT uint64 powerModulo(uint64 base, uint64 expontent, uint64 module)
Computes base power exponent modulo module.
Definition: math.cpp:51
#define CPP_UTILITIES_EXPORT
Marks the symbol to be exported by the c++utilities library.