Dataflow Runtime API  3.1.1.0
Static Public Member Functions | List of all members
imt::base::core::math::MathUtils Class Reference

Mathematical utility functions. More...

#include <Imt.Base.Core.Math/MathUtils.h>

Static Public Member Functions

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...
 

Detailed Description

Mathematical utility functions.

Pure static class.

Member Function Documentation

◆ 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
floatToRoundToIntThe 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
valueValue to round.
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
valueThe value to be forced.
minRangeThe minimum value of the range.
maxRangeThe 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: