The class implements helper functions for mathematical operations.
More...
#include <mathfuncs.h>
|
| template<typename T > |
| static bool | inRange (T input, T minimum, T maximum) |
| | Indicates whether a value falls within a specified range. More...
|
| |
| template<typename T > |
| static T | ensureRange (T input, T minimum, T maximum) |
| | Function returns a value that is guaranteed to be within a specified range. More...
|
| |
| template<typename T > |
| static bool | areSame (T first, T second, T epsilon=(T) std::numeric_limits< T >::epsilon()) |
| | Function checks if two values are the same within data types limitation. More...
|
| |
| template<typename T > |
| static bool | isZero (T input, T epsilon=(T) std::numeric_limits< T >::epsilon()) |
| | Function checks if value is zero. More...
|
| |
| template<typename T > |
| static T | gcd (T first, T second) |
| | Function returns greatest common divisor for two values. More...
|
| |
| template<typename T > |
| static T | lcm (T first, T second) |
| | Function returns lowest common multiple for for two values. More...
|
| |
The class implements helper functions for mathematical operations.
◆ areSame()
template<typename T >
| bool MathFuncs::areSame |
( |
T |
first, |
|
|
T |
second, |
|
|
T |
epsilon = (T) std::numeric_limits<T>::epsilon() |
|
) |
| |
|
static |
Function checks if two values are the same within data types limitation.
- Parameters
-
| first | value |
| second | value |
| limit | |
- Returns
- function returns true is values are the same
◆ ensureRange()
template<typename T >
| T MathFuncs::ensureRange |
( |
T |
input, |
|
|
T |
minimum, |
|
|
T |
maximum |
|
) |
| |
|
static |
Function returns a value that is guaranteed to be within a specified range.
- Parameters
-
| input | value |
| minimum | value |
| maximum | value |
- Returns
- function returns a value that is guaranteed to be within a specified range
◆ gcd()
template<typename T >
| T MathFuncs::gcd |
( |
T |
first, |
|
|
T |
second |
|
) |
| |
|
static |
Function returns greatest common divisor for two values.
- Parameters
-
- Returns
- function returns greatest common divisor
◆ inRange()
template<typename T >
| bool MathFuncs::inRange |
( |
T |
input, |
|
|
T |
minimum, |
|
|
T |
maximum |
|
) |
| |
|
static |
Indicates whether a value falls within a specified range.
- Parameters
-
| input | value |
| minimum | value |
| maximum | value |
- Returns
- function returns true if value is greater than or equal to aMin and less than or Equal to aMax. It returns false if value is less than aMin or greater than aMax
◆ isZero()
template<typename T >
| bool MathFuncs::isZero |
( |
T |
input, |
|
|
T |
epsilon = (T) std::numeric_limits<T>::epsilon() |
|
) |
| |
|
static |
Function checks if value is zero.
- Parameters
-
- Returns
- function returns true is value is zero
◆ lcm()
template<typename T >
| T MathFuncs::lcm |
( |
T |
first, |
|
|
T |
second |
|
) |
| |
|
static |
Function returns lowest common multiple for for two values.
- Parameters
-
- Returns
- function returns lowest common multiple
The documentation for this class was generated from the following file:
- C:/CProjects/Libs/CommonLib/include/commonlib/mathematics/mathfuncs.h