Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
template<typename T >
T kAdjustCeil ( const T &  value,
const T &  min,
const T &  max,
const T &  granularity 
)

Rounds the specified input up, conforming to minimum, maximum, and granularity constraints.

Granularity represents the step size (quantum) between valid output values. It is interpreted as relative to the specified min value. E.g., with min=3, max=7, and granularity=2, output values would be constrained to {3, 5, 7}.

This method requires C++ 2011; accordingly, it cannot be used in inline functions that may be processed by C compilers or older C++ compilers.

Parameters
valueInput value.
minMinimum value.
maxMaximum value.
granularityGranularity (must be positive).
Returns
Input value, rounded up to nearest multiple of granularity between min and max.