2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\" <mtk.manpages@gmail.com>
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
8 .\" References consulted:
9 .\" Linux libc source code
10 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
12 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
13 .\" Modified 1995-08-14 by Arnt Gulbrandsen <agulbra@troll.no>
14 .\" Modified 2002-07-27 by Walter Harms
15 .\" (walter.harms@informatik.uni-oldenburg.de)
17 .TH log2 3 (date) "Linux man-pages (unreleased)"
19 log2, log2f, log2l \- base-2 logarithmic function
22 .RI ( libm ", " \-lm )
27 .BI "double log2(double " x );
28 .BI "float log2f(float " x );
29 .BI "long double log2l(long double " x );
33 Feature Test Macro Requirements for glibc (see
34 .BR feature_test_macros (7)):
41 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
44 These functions return the base 2 logarithm of
47 On success, these functions return the base 2 logarithm of
50 For special cases, including where
52 is 0, 1, negative, infinity, or NaN, see
57 for information on how to determine whether an error has occurred
58 when calling these functions.
60 For a discussion of the errors that can occur for these functions, see
63 For an explanation of the terms used in this section, see
69 Interface Attribute Value
76 T} Thread safety MT-Safe