Main MRPT website > C++ reference for MRPT 1.4.0
Functions
Round functions (in #include <mrpt/utils/round.h>)

Detailed Description

Collaboration diagram for Round functions (in #include <mrpt/utils/round.h>):

Functions

template<typename T >
int mrpt::utils::round (const T value)
 Returns the closer integer (int) to x.
 
template<typename T >
long mrpt::utils::round_long (const T value)
 Returns the closer integer (long) to x.
 
template<class T >
mrpt::utils::round_10power (T val, int power10)
 Round a decimal number up to the given 10'th power (eg, to 1000,100,10, and also fractions) power10 means round up to: 1 -> 10, 2 -> 100, 3 -> 1000, ... -1 -> 0.1, -2 -> 0.01, ...
 

Function Documentation

◆ round()

template<typename T >
int mrpt::utils::round ( const T  value)
inline

◆ round_10power()

template<class T >
T mrpt::utils::round_10power ( val,
int  power10 
)

Round a decimal number up to the given 10'th power (eg, to 1000,100,10, and also fractions) power10 means round up to: 1 -> 10, 2 -> 100, 3 -> 1000, ... -1 -> 0.1, -2 -> 0.01, ...

Definition at line 72 of file round.h.

References mrpt::utils::round_long(), and t().

◆ round_long()

template<typename T >
long mrpt::utils::round_long ( const T  value)
inline

Returns the closer integer (long) to x.

Definition at line 48 of file round.h.

References t().

Referenced by mrpt::utils::round_10power().




Page generated by Doxygen 1.9.7 for MRPT 1.4.0 SVN: at Tue Jun 13 13:45:58 UTC 2023