bpp-core3  3.0.0
bpp::IntegerTools Namespace Reference

Namespace for integer utils. More...

Functions

template<typename T >
divideDown (T n, T divisor) noexcept
 Returns floor(n/divisor). More...
 
template<typename T >
divideUp (T n, T divisor) noexcept
 Returns ceil (n/divisor). More...
 
template<typename T >
roundDown (T n, T divisor) noexcept
 Round n to previous divisor multiple. More...
 
template<typename T >
roundUp (T n, T divisor) noexcept
 Round n to next divisor multiple. More...
 

Detailed Description

Namespace for integer utils.

Function Documentation

◆ divideDown()

template<typename T >
T bpp::IntegerTools::divideDown ( n,
divisor 
)
noexcept

Returns floor(n/divisor).

Definition at line 18 of file IntegerTools.h.

Referenced by divideUp(), roundDown(), and bpp::TextTools::split().

◆ divideUp()

template<typename T >
T bpp::IntegerTools::divideUp ( n,
divisor 
)
noexcept

Returns ceil (n/divisor).

Definition at line 26 of file IntegerTools.h.

References divideDown().

Referenced by roundUp(), and bpp::TextTools::split().

◆ roundDown()

template<typename T >
T bpp::IntegerTools::roundDown ( n,
divisor 
)
noexcept

Round n to previous divisor multiple.

Definition at line 34 of file IntegerTools.h.

References divideDown().

◆ roundUp()

template<typename T >
T bpp::IntegerTools::roundUp ( n,
divisor 
)
noexcept

Round n to next divisor multiple.

Definition at line 42 of file IntegerTools.h.

References divideUp().