Mathematical utility functions.
More...
#include <Imt.Base.Core.Math/MathUtils.h>
|
template<typename Type > |
static Type | truncateToRange (const Type value, const Type minRange, const Type maxRange) |
| Force a value to be in the range given by min and max. More...
|
|
template<class T > |
static int32_t | roundToInt (const T floatToRoundToInt) |
| Round a floating point value to the next integer value. More...
|
|
static uint32_t | roundToNextFive (const uint32_t value) |
| Round an integer value to the next multiple of five. More...
|
|
Mathematical utility functions.
Pure static class.
◆ roundToInt()
template<class T >
static int32_t imt::base::core::math::MathUtils::roundToInt |
( |
const T |
floatToRoundToInt | ) |
|
|
inlinestatic |
Round a floating point value to the next integer value.
Example: roundToInt(-5.5) == -6. roundToInt(-5.4) == -5. roundToInt(5.4) == 5. roundToInt(5.5) == 6.
- Parameters
-
floatToRoundToInt | The value to be rounded. |
- Returns
- Rounded integer.
◆ roundToNextFive()
static uint32_t imt::base::core::math::MathUtils::roundToNextFive |
( |
const uint32_t |
value | ) |
|
|
inlinestatic |
Round an integer value to the next multiple of five.
- Parameters
-
- Returns
- Rounded value.
◆ truncateToRange()
template<typename Type >
static Type imt::base::core::math::MathUtils::truncateToRange |
( |
const Type |
value, |
|
|
const Type |
minRange, |
|
|
const Type |
maxRange |
|
) |
| |
|
inlinestatic |
Force a value to be in the range given by min and max.
- Parameters
-
value | The value to be forced. |
minRange | The minimum value of the range. |
maxRange | The maximum value of the range. |
- Returns
- Value forced to be in range of min and max.
The documentation for this class was generated from the following file: