36 #ifndef MATHSCUSTOMFUNCTIONS_HPP_
37 #define MATHSCUSTOMFUNCTIONS_HPP_
54 double SmallPow(
double x,
unsigned exponent);
63 unsigned SmallPow(
unsigned x,
unsigned exponent);
74 bool Divides(
double smallerNumber,
double largerNumber);
83 unsigned CeilDivide(
unsigned numerator,
unsigned denominator);
90 double Signum(
double value);
106 static bool IsNearZero(
double number,
double tolerance);
136 static bool WithinTolerance(
double number1,
double number2,
double tolerance,
bool toleranceIsAbsolute);
149 double relTol=DBL_EPSILON,
double absTol=DBL_EPSILON,
150 bool printError=
false);
159 static double Difference(
double number1,
double number2,
bool toleranceIsAbsolute);
static bool WithinAnyTolerance(double number1, double number2, double relTol=DBL_EPSILON, double absTol=DBL_EPSILON, bool printError=false)
double SmallPow(double x, unsigned exponent)
unsigned CeilDivide(unsigned numerator, unsigned denominator)
bool Divides(double smallerNumber, double largerNumber)
double Signum(double value)
static double Difference(double number1, double number2, bool toleranceIsAbsolute)
static bool WithinRelativeTolerance(double number1, double number2, double tolerance)
static bool WithinAbsoluteTolerance(double number1, double number2, double tolerance)
static bool IsNearZero(double number, double tolerance)
static bool WithinTolerance(double number1, double number2, double tolerance, bool toleranceIsAbsolute)