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);
98 double SafeDivide(
double numerator,
double divisor);
114 static bool IsNearZero(
double number,
double tolerance);
144 static bool WithinTolerance(
double number1,
double number2,
double tolerance,
bool toleranceIsAbsolute);
157 double relTol=DBL_EPSILON,
double absTol=DBL_EPSILON,
158 bool printError=
false);
167 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)
double SafeDivide(double numerator, double divisor)
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)