1log2(3)                    Library Functions Manual                    log2(3)
2
3
4

NAME

6       log2, log2f, log2l - base-2 logarithmic function
7

LIBRARY

9       Math library (libm, -lm)
10

SYNOPSIS

12       #include <math.h>
13
14       double log2(double x);
15       float log2f(float x);
16       long double log2l(long double x);
17
18   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20       log2(), log2f(), log2l():
21           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
22

DESCRIPTION

24       These functions return the base 2 logarithm of x.
25

RETURN VALUE

27       On success, these functions return the base 2 logarithm of x.
28
29       For  special  cases,  including where x is 0, 1, negative, infinity, or
30       NaN, see log(3).
31

ERRORS

33       See math_error(7) for information on how to determine whether an  error
34       has occurred when calling these functions.
35
36       For  a discussion of the errors that can occur for these functions, see
37       log(3).
38

ATTRIBUTES

40       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
41       tributes(7).
42
43       ┌────────────────────────────────────────────┬───────────────┬─────────┐
44Interface                                   Attribute     Value   
45       ├────────────────────────────────────────────┼───────────────┼─────────┤
46log2(), log2f(), log2l()                    │ Thread safety │ MT-Safe │
47       └────────────────────────────────────────────┴───────────────┴─────────┘
48

STANDARDS

50       C11, POSIX.1-2008.
51

HISTORY

53       glibc 2.1.  C99, POSIX.1-2001.
54
55       The variant returning double also conforms to SVr4, 4.3BSD.
56

SEE ALSO

58       cbrt(3), clog2(3), log(3), log10(3), sqrt(3)
59
60
61
62Linux man-pages 6.04              2023-03-30                           log2(3)
Impressum