]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/log2.3
log2.3, log10.3: wfix
[thirdparty/man-pages.git] / man3 / log2.3
1 '\" t
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>
5 .\"
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\"
8 .\" References consulted:
9 .\" Linux libc source code
10 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
11 .\" 386BSD man pages
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)
16 .\"
17 .TH log2 3 (date) "Linux man-pages (unreleased)"
18 .SH NAME
19 log2, log2f, log2l \- base-2 logarithmic function
20 .SH LIBRARY
21 Math library
22 .RI ( libm ", " \-lm )
23 .SH SYNOPSIS
24 .nf
25 .B #include <math.h>
26 .P
27 .BI "double log2(double " x );
28 .BI "float log2f(float " x );
29 .BI "long double log2l(long double " x );
30 .fi
31 .P
32 .RS -4
33 Feature Test Macro Requirements for glibc (see
34 .BR feature_test_macros (7)):
35 .RE
36 .P
37 .BR log2 (),
38 .BR log2f (),
39 .BR log2l ():
40 .nf
41 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
42 .fi
43 .SH DESCRIPTION
44 These functions return the base-2 logarithm of
45 .IR x .
46 .SH RETURN VALUE
47 On success, these functions return the base-2 logarithm of
48 .IR x .
49 .P
50 For special cases, including where
51 .I x
52 is 0, 1, negative, infinity, or NaN, see
53 .BR log (3).
54 .SH ERRORS
55 See
56 .BR math_error (7)
57 for information on how to determine whether an error has occurred
58 when calling these functions.
59 .P
60 For a discussion of the errors that can occur for these functions, see
61 .BR log (3).
62 .SH ATTRIBUTES
63 For an explanation of the terms used in this section, see
64 .BR attributes (7).
65 .TS
66 allbox;
67 lbx lb lb
68 l l l.
69 Interface Attribute Value
70 T{
71 .na
72 .nh
73 .BR log2 (),
74 .BR log2f (),
75 .BR log2l ()
76 T} Thread safety MT-Safe
77 .TE
78 .SH STANDARDS
79 C11, POSIX.1-2008.
80 .SH HISTORY
81 glibc 2.1.
82 C99, POSIX.1-2001.
83 .P
84 The variant returning
85 .I double
86 also conforms to
87 SVr4, 4.3BSD.
88 .SH SEE ALSO
89 .BR cbrt (3),
90 .BR clog2 (3),
91 .BR log (3),
92 .BR log10 (3),
93 .BR sqrt (3)