folly::divCeil

Returns num/denom, rounded toward positive infinity. Put another way, returns the smallest integral value that is greater than or equal to the exact (not rounded) fraction num/denom.

Synopsis

Declared in <folly/Math.h>

template<
    typename N,
    typename D>
constexpr
/* implementation-defined */
divCeil(
    N num,
    D denom);

Description

This function undergoes the same integer promotion rules as a built-in operator, except that we don't allow bool -> int promotion. This function is undefined if denom == 0. It is also undefined if the result type T is a signed type, num is std::numeric_limits<T>::min(), and denom is equal to -1 after conversion to the result type.

Return Value

num/denom, rounded toward positive infinity.

Parameters

NameDescription
numThe dividend.
denomThe divisor.