36#ifndef MATHSCUSTOMFUNCTIONS_HPP_
37#define MATHSCUSTOMFUNCTIONS_HPP_
55double SmallPow(
double x,
unsigned exponent);
64unsigned SmallPow(
unsigned x,
unsigned exponent);
75bool Divides(
double smallerNumber,
double largerNumber);
84unsigned CeilDivide(
unsigned numerator,
unsigned denominator);
91double Signum(
double value);
99double SafeDivide(
double numerator,
double divisor);
113unsigned AdvanceMod(
unsigned index,
int increment, std::size_t range)
noexcept;
140 static bool IsNearZero(
double number,
double tolerance);
170 static bool WithinTolerance(
double number1,
double number2,
double tolerance,
bool toleranceIsAbsolute);
183 double relTol=DBL_EPSILON,
double absTol=DBL_EPSILON,
184 bool printError=
false);
193 static double Difference(
double number1,
double number2,
bool toleranceIsAbsolute);
bool Divides(double smallerNumber, double largerNumber)
double SmallPow(double x, unsigned exponent)
double SafeDivide(double numerator, double divisor)
unsigned SmallDifferenceMod(unsigned idxA, unsigned idxB, std::size_t range) noexcept
unsigned CeilDivide(unsigned numerator, unsigned denominator)
unsigned AdvanceMod(unsigned index, int increment, std::size_t range) noexcept
double Signum(double value)
static bool IsNearZero(double number, double tolerance)
static bool WithinAnyTolerance(double number1, double number2, double relTol=DBL_EPSILON, double absTol=DBL_EPSILON, bool printError=false)
static bool WithinTolerance(double number1, double number2, double tolerance, bool toleranceIsAbsolute)
static bool WithinRelativeTolerance(double number1, double number2, double tolerance)
static double Difference(double number1, double number2, bool toleranceIsAbsolute)
static bool WithinAbsoluteTolerance(double number1, double number2, double tolerance)