Go to the source code of this file.
Functions | |
bool | fuzzyCompare (double a, double b) |
Tests if two double values are nearly equal. More... | |
bool | fuzzyCompare (float a, float b) |
Tests if two float values are nearly equal. More... | |
double | hypot (double x, double y, double z) |
template<typename floatT > | |
bool | isNaN (floatT x) |
Checks if a floating point value is Not-a-Number (NaN) More... | |
double | normalizeRadians (double radians) |
template<typename IntT > | |
IntT | round_to_int (float floatValue) |
Round to the closest integer. More... | |
template<typename IntT > | |
IntT | round_to_int (double floatValue) |
Round to the closest integer. More... | |
double | sqr (double val) |
Variables | |
const double | NaN_double |
Not-a-Number in double precision. More... | |
|
inline |
Tests if two double
values are nearly equal.
true
if the two double
numbers are equal in terms of the machine precision, which means their difference must be less than 1E-11. Definition at line 28 of file MathToolbox.hpp.
|
inline |
Tests if two float
values are nearly equal.
true
if the two float
numbers are equal in terms of the machine precision, which means their difference must be less than 1E-6. Definition at line 47 of file MathToolbox.hpp.
double hypot | ( | double | x, |
double | y, | ||
double | z | ||
) |
Berechne die Laenge der Hypothenuse
Definition at line 19 of file MathToolbox.cpp.
|
inline |
Checks if a floating point value is Not-a-Number (NaN)
The floating-point standard IEC 559 (a.k.a. IEEE 754) specifies that a floating-point value x represents NaN if x != x.
Definition at line 63 of file MathToolbox.hpp.
double normalizeRadians | ( | double | radians | ) |
Normalizes an angle given in radians by adding or subtracting an integer multiple of 2*pi so that the resulting angle is in the half-open interval [-pi,+pi). The current implementation takes O(1) time, i.e. the time of execution has a fixed upper boundary independend from the angle.
Definition at line 31 of file MathToolbox.cpp.
|
inline |
Round to the closest integer.
floatValue | The float value that shall be rounded |
Definition at line 74 of file MathToolbox.hpp.
|
inline |
Round to the closest integer.
floatValue | The float value that shall be rounded |
Definition at line 88 of file MathToolbox.hpp.
|
inline |
Definition at line 36 of file MathToolbox.hpp.
const double NaN_double |
Not-a-Number in double precision.
Definition at line 13 of file MathToolbox.cpp.