*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: powerof2 | Section: 9 | Source: NetBSD | File: powerof2.9
ROUNDUP(9) FreeBSD Kernel Developer's Manual ROUNDUP(9) NAME roundup - macros for counting and rounding SYNOPSIS #include <sys/param.h> size howmany(x, size); size roundup(x, size); size rounddown(x, size); size roundup2(x, size); size rounddown2(x, size); int powerof2(x); DESCRIPTION The 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() and rounddown2() macros also round up and down, respectively, but with the assumption that size is a power of two. If x is indeed a power of two, powerof2() return 1. RETURN VALUES The 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. EXAMPLES The following example rounds the variable rx to a 32-bit boundary: uint16_t rx; ... rx = roundup2(rx, sizeof(uint32_t)); SEE ALSO ilog2(3), param(3), imax(9) CAVEATS All described macros make no assumptions about the type of the parameters. These are implicitly assumed to be unsigned integers. FreeBSD 14.1-RELEASE-p8 October 2, 2019 FreeBSD 14.1-RELEASE-p8

Navigation Options