![]() |
GM6000 Digital Heater Controller Branch: main
SDX-1330
|
The Math namespace provides classes, utilities, etc. More...
The Math namespace provides classes, utilities, etc.
related to numeric operations.
Classes | |
class | IntegerExpressionParser |
This template class evaluates an null terminate string that represents an integer arithmetic expression. More... | |
class | RealExpressionParser |
This template class evaluates an null terminate string that represents an real-number arithmetic expression. More... | |
Functions | |
void | incrementLargeInteger (uint8_t *integerToBeIncrement, int integerSizeInBytes, uint8_t incValue=1, bool littleEndian=true) noexcept |
This method treats the binary array a single 'large integer' and increment the array/large-integer by N. | |
template<class T > | |
bool | almostEquals (T a, T b, T epsilon) |
This template function implements a 'almost equals' comparison function for floating points numbers. | |
bool | areFloatsEqual (float a, float b, float epsilon=CPL_MATH_REAL_FLOAT_EPSILON) |
This method is short hand for almostEquals<float> AND provides a default epsilon. | |
bool | areDoublesEqual (double a, double b, double epsilon=CPL_MATH_REAL_DOUBLE_EPSILON) |
This method is short hand for almostEquals<double> AND provides a default epsilon. | |
bool Cpl::Math::almostEquals | ( | T | a, |
T | b, | ||
T | epsilon | ||
) |
This template function implements a 'almost equals' comparison function for floating points numbers.
See the following link for why an 'almost equals' function is necessary:
http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
|
inline |
This method is short hand for almostEquals<double> AND provides a default epsilon.
|
inline |
This method is short hand for almostEquals<float> AND provides a default epsilon.
|
noexcept |
This method treats the binary array a single 'large integer' and increment the array/large-integer by N.
N is limited to [0,255].
If the 'littleEndian' flag is set to the true, then the increment starts with the first byte in the array; else the increment starts with the last byte in the array.