ipiq: Add simple IPI latency measure sysctls (2)
[dragonfly.git] / lib / libm / man / log.3
1 .\" Copyright (c) 2008-2010 David Schultz <das@FreeBSD.org>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD: head/lib/msun/man/log.3 251292 2013-06-03 09:14:31Z das $
26 .\"
27 .Dd June 11, 2013
28 .Dt LOG 3
29 .Os
30 .Sh NAME
31 .Nm log ,
32 .Nm logf ,
33 .Nm logl ,
34 .Nm log10 ,
35 .Nm log10f ,
36 .Nm log10l ,
37 .Nm log2 ,
38 .Nm log2f ,
39 .Nm log2l ,
40 .Nm log1p ,
41 .Nm log1pf ,
42 .Nm log1pl
43 .Nd logarithm functions
44 .Sh LIBRARY
45 .Lb libm
46 .Sh SYNOPSIS
47 .In math.h
48 .Ft double
49 .Fn log "double x"
50 .Ft float
51 .Fn logf "float x"
52 .Ft long double
53 .Fn logl "long double x"
54 .Ft double
55 .Fn log10 "double x"
56 .Ft float
57 .Fn log10f "float x"
58 .Ft long double
59 .Fn log10l "long double x"
60 .Ft double
61 .Fn log2 "double x"
62 .Ft float
63 .Fn log2f "float x"
64 .Ft long double
65 .Fn log2l "long double x"
66 .Ft double
67 .Fn log1p "double x"
68 .Ft float
69 .Fn log1pf "float x"
70 .Ft long double
71 .Fn log1pl "long double x"
72 .Sh DESCRIPTION
73 The
74 .Fn log ,
75 .Fn logf ,
76 and
77 .Fn logl
78 functions compute the natural logarithm of
79 .Fa x .
80 .Pp
81 The
82 .Fn log10 ,
83 .Fn log10f ,
84 and
85 .Fn log10l
86 functions compute the logarithm base 10 of
87 .Fa x ,
88 while
89 .Fn log2 ,
90 .Fn log2f ,
91 and
92 .Fn log2l
93 compute the logarithm base 2 of
94 .Fa x .
95 .Pp
96 The
97 .Fn log1p ,
98 .Fn log1pf ,
99 and
100 .Fn log1pl
101 functions compute the natural logarithm of
102 .No "1 + x" .
103 Computing the natural logarithm as
104 .Li log1p(x)
105 is more accurate than computing it as
106 .Li log(1 + x)
107 when
108 .Fa x
109 is close to zero.
110 .Sh RETURN VALUES
111 These functions return the requested logarithm; the logarithm of 1 is +0.
112 An attempt to take the logarithm of \*(Pm0 results in a divide-by-zero
113 exception, and -\*(If is returned.
114 Otherwise, attempting to take the logarithm of a negative number
115 results in an invalid exception and a return value of \*(Na.
116 .Sh SEE ALSO
117 .Xr exp 3 ,
118 .Xr ilogb 3 ,
119 .Xr math 3 ,
120 .Xr pow 3
121 .Sh STANDARDS
122 The
123 .Fn log ,
124 .Fn logf ,
125 .Fn logl ,
126 .Fn log10 ,
127 .Fn log10f ,
128 .Fn log10l ,
129 .Fn log2 ,
130 .Fn log2f ,
131 .Fn log2l ,
132 .Fn log1p ,
133 .Fn log1pf ,
134 and
135 .Fn log1pl
136 functions conform to
137 .St -isoC-99 .