*** 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: ilog2 | Section: 3 | Source: NetBSD | File: ilog2.3
ILOG2(3) FreeBSD Library Functions Manual ILOG2(3) NAME ilog2 - integer base-2 logarithm SYNOPSIS #include <sys/bitops.h> int ilog2(size x); DESCRIPTION For positive x, the ilog2() macro returns the integer part of the base-2 logarithm of x; that is, floor(log_2(x)). If n = ilog2(x), then n is the largest integer such that 2**n <= x; in other words, ilog2() returns the largest integer to which 2 can be raised to obtain a value at most x. The type of the input parameter must be unsigned. If x is a constant expression, then so is ilog2(x). ERRORS ilog2() returns -1 when x is zero. SEE ALSO bitops(3), ffs(3), ilogb(3), log2(3), imax(9), powerof2(9) HISTORY The ilog2() macro first appeared in NetBSD 5.0. FreeBSD 14.1-RELEASE-p8 November 5, 2021 FreeBSD 14.1-RELEASE-p8

Navigation Options