Return the least multiple of boundary not less than value.

Synopsis

Declared in <bdlb_bitutil.h>

static
unsigned int
roundUp(
    unsigned int value,
    unsigned int boundary);

Description

Return the least multiple of the specified boundary that is greater than or equal to the specified value, and 0 if 0 == value or the conversion was not successful. The behavior is undefined unless 1 == numBitsSet(boundary). Note that the conversion will succeed if and only if 0 == value % boundary or (1 << sizeInBits(value)) > (value / boundary + 1) * boundary.

Return Value

least multiple of boundary not less than value, or 0

Parameters

Name

Description

value

value to round up

boundary

power‐of‐two alignment boundary

Created with MrDocs