Command:

LOG2(3) Linux Programmer's Manual LOG2(3)NAMElog2, log2f, log2l - base-2 logarithmic functionSYNOPSIS#include<math.h>doublelog2(doublex);floatlog2f(floatx);longdoublelog2l(longdoublex);Link with-lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)):log2(),log2f(),log2l(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; orcc-std=c99DESCRIPTIONThelog2() function returns the base 2 logarithm ofx.RETURNVALUEOn success, these functions return the base 2 logarithm ofx. For special cases, including wherexis 0, 1, negative, infinity, or NaN, see log(3).ERRORSSee math_error(7) for information on how to determine whether an error has occurred when calling these func- tions. For a discussion of the errors that can occur for these functions, see log(3).VERSIONSThese functions first appeared in glibc in version 2.1.CONFORMINGTOC99, POSIX.1-2001. The variant returningdoublealso conforms to SVr4, 4.3BSD, C89.SEEALSOcbrt(3), clog2(3), sqrt(3)COLOPHONThis page is part of release 3.22 of the Linuxman-pagesproject. A description of the project, and informa- tion about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-11 LOG2(3)