]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/log2.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / log2.3
CommitLineData
fea681da 1.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3d352631
MK
2.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3.\" <mtk.manpages@gmail.com>
fea681da 4.\"
5fbde956 5.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
6.\"
7.\" References consulted:
8.\" Linux libc source code
9.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10.\" 386BSD man pages
11.\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
12.\" Modified 1995-08-14 by Arnt Gulbrandsen <agulbra@troll.no>
13.\" Modified 2002-07-27 by Walter Harms
14.\" (walter.harms@informatik.uni-oldenburg.de)
15.\"
45186a5d 16.TH LOG2 3 2021-03-22 "Linux man-pages (unreleased)"
fea681da
MK
17.SH NAME
18log2, log2f, log2l \- base-2 logarithmic function
d1482b90
AC
19.SH LIBRARY
20Math library
8fc3b2cf 21.RI ( libm ", " \-lm )
fea681da
MK
22.SH SYNOPSIS
23.nf
24.B #include <math.h>
68e4db0a 25.PP
fea681da 26.BI "double log2(double " x );
fea681da 27.BI "float log2f(float " x );
fea681da
MK
28.BI "long double log2l(long double " x );
29.fi
68e4db0a 30.PP
d39ad78f 31.RS -4
cc4615cc
MK
32Feature Test Macro Requirements for glibc (see
33.BR feature_test_macros (7)):
d39ad78f 34.RE
68e4db0a 35.PP
cc4615cc
MK
36.BR log2 (),
37.BR log2f (),
38.BR log2l ():
9d2adbae 39.nf
5c10d2c5 40 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
9d2adbae 41.fi
fea681da 42.SH DESCRIPTION
5600f73a 43These functions return the base 2 logarithm of
022671eb 44.IR x .
3d352631
MK
45.SH RETURN VALUE
46On success, these functions return the base 2 logarithm of
47.IR x .
847e0d88 48.PP
3d352631
MK
49For special cases, including where
50.I x
51is 0, 1, negative, infinity, or NaN, see
52.BR log (3).
fea681da 53.SH ERRORS
3d352631
MK
54See
55.BR math_error (7)
56for information on how to determine whether an error has occurred
57when calling these functions.
847e0d88 58.PP
3d352631
MK
59For a discussion of the errors that can occur for these functions, see
60.BR log (3).
f0d7ce1d
MK
61.SH VERSIONS
62These functions first appeared in glibc in version 2.1.
b66a6589
MS
63.SH ATTRIBUTES
64For an explanation of the terms used in this section, see
65.BR attributes (7).
c466875e
MK
66.ad l
67.nh
b66a6589
MS
68.TS
69allbox;
c466875e 70lbx lb lb
b66a6589
MS
71l l l.
72Interface Attribute Value
73T{
74.BR log2 (),
75.BR log2f (),
76.BR log2l ()
77T} Thread safety MT-Safe
78.TE
c466875e
MK
79.hy
80.ad
81.sp 1
3113c7f3 82.SH STANDARDS
9a74e018 83C99, POSIX.1-2001, POSIX.1-2008.
847e0d88 84.PP
3d352631
MK
85The variant returning
86.I double
87also conforms to
3c78ebef 88SVr4, 4.3BSD.
47297adb 89.SH SEE ALSO
fea681da 90.BR cbrt (3),
36268806 91.BR clog2 (3),
be62f421
JE
92.BR log (3),
93.BR log10 (3),
fea681da 94.BR sqrt (3)