[#CeilDiv] = CeilDiv :mrdocs: Integer ceiling division (for unsigned values). == Synopsis Declared in `<util/overflow.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::unsigned_integral Dividend, std::unsigned_integral Divisor> [[nodiscard]] constexpr auto CeilDiv( Dividend const dividend, Divisor const divisor); ---- == Description Computes the smallest integer q such that q * divisor >= dividend. Both dividend and divisor must be unsigned, and divisor must be non‐zero. The implementation avoids overflow that can occur with `(dividend + divisor ‐ 1) / divisor`. == Return Value The smallest integer q such that `q * divisor >= dividend`. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *dividend* | The value being divided. | *divisor* | The value to divide by, which must be non‐zero. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#