Query: rounddown
OS: netbsd
Section: 9
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
ROUNDUP(9) BSD Kernel Developer's Manual ROUNDUP(9)NAMEroundup -- macros for counting and roundingSYNOPSIS#include <sys/param.h> size howmany(x, size); size roundup(x, size); size rounddown(x, size); size roundup2(x, size); int powerof2(x);DESCRIPTIONThe roundup() and rounddown() macros return an integer from rounding x up and down, respectively, to the next size. The howmany() macro in turn reveals how many times size fits into x, rounding the residual up. The roundup2() macro also rounds up, but with the assumption that size is a power of two. If x is indeed a power of two, powerof2() return 1.RETURN VALUESThe return value is an integer from the respective operation. If x is 0, all macros except powerof2() return 0. The behavior is undefined if size is 0.EXAMPLESThe following example rounds the variable rx to a 32-bit boundary: uint16_t rx; ... rx = roundup2(rx, sizeof(uint32_t));SEE ALSOilog2(3), param(3), imax(9)CAVEATSAll described macros make no assumptions about the type of the parameters. These are implicitly assumed to be unsigned integers.BSDJune 1, 2011 BSD
Related Man Pages |
---|
min(3) - netbsd |
stack_shrink(9) - netbsd |
howmany(9) - netbsd |
powerof2(9) - netbsd |
roundup2(9) - netbsd |
Similar Topics in the Unix Linux Community |
---|
How to get the size of process in Bytes |
du -k shows different size in two nodes |
file size counts?? |
HACMP LV size is not reflecting |