ipiq: Add simple IPI latency measure sysctls (2)
[dragonfly.git] / lib / libm / man / log.3
CommitLineData
8cecb502 1.\" Copyright (c) 2008-2010 David Schultz <das@FreeBSD.org>
74dfd0cf
JM
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.\"
8cecb502
JM
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.\"
a8a6a916 25.\" $FreeBSD: head/lib/msun/man/log.3 251292 2013-06-03 09:14:31Z das $
74dfd0cf 26.\"
a8a6a916 27.Dd June 11, 2013
74dfd0cf
JM
28.Dt LOG 3
29.Os
30.Sh NAME
31.Nm log ,
32.Nm logf ,
8cecb502 33.Nm logl ,
74dfd0cf
JM
34.Nm log10 ,
35.Nm log10f ,
a8a6a916 36.Nm log10l ,
74dfd0cf
JM
37.Nm log2 ,
38.Nm log2f ,
a8a6a916 39.Nm log2l ,
8cecb502 40.Nm log1p ,
a8a6a916
JM
41.Nm log1pf ,
42.Nm log1pl
74dfd0cf
JM
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"
a8a6a916
JM
52.Ft long double
53.Fn logl "long double x"
74dfd0cf
JM
54.Ft double
55.Fn log10 "double x"
56.Ft float
57.Fn log10f "float x"
a8a6a916
JM
58.Ft long double
59.Fn log10l "long double x"
74dfd0cf 60.Ft double
74dfd0cf
JM
61.Fn log2 "double x"
62.Ft float
63.Fn log2f "float x"
a8a6a916
JM
64.Ft long double
65.Fn log2l "long double x"
8cecb502
JM
66.Ft double
67.Fn log1p "double x"
68.Ft float
69.Fn log1pf "float x"
a8a6a916
JM
70.Ft long double
71.Fn log1pl "long double x"
74dfd0cf 72.Sh DESCRIPTION
74dfd0cf 73The
a8a6a916
JM
74.Fn log ,
75.Fn logf ,
74dfd0cf 76and
a8a6a916 77.Fn logl
8cecb502
JM
78functions compute the natural logarithm of
79.Fa x .
80.Pp
74dfd0cf 81The
a8a6a916
JM
82.Fn log10 ,
83.Fn log10f ,
74dfd0cf 84and
a8a6a916 85.Fn log10l
8cecb502
JM
86functions compute the logarithm base 10 of
87.Fa x ,
88while
a8a6a916
JM
89.Fn log2 ,
90.Fn log2f ,
74dfd0cf 91and
a8a6a916 92.Fn log2l
8cecb502 93compute the logarithm base 2 of
74dfd0cf 94.Fa x .
74dfd0cf 95.Pp
8cecb502 96The
a8a6a916
JM
97.Fn log1p ,
98.Fn log1pf ,
8cecb502 99and
a8a6a916 100.Fn log1pl
8cecb502
JM
101functions compute the natural logarithm of
102.No "1 + x" .
103Computing the natural logarithm as
104.Li log1p(x)
105is more accurate than computing it as
106.Li log(1 + x)
107when
74dfd0cf 108.Fa x
8cecb502
JM
109is close to zero.
110.Sh RETURN VALUES
111These functions return the requested logarithm; the logarithm of 1 is +0.
112An attempt to take the logarithm of \*(Pm0 results in a divide-by-zero
113exception, and -\*(If is returned.
114Otherwise, attempting to take the logarithm of a negative number
115results in an invalid exception and a return value of \*(Na.
74dfd0cf
JM
116.Sh SEE ALSO
117.Xr exp 3 ,
118.Xr ilogb 3 ,
8cecb502
JM
119.Xr math 3 ,
120.Xr pow 3
74dfd0cf 121.Sh STANDARDS
8cecb502
JM
122The
123.Fn log ,
124.Fn logf ,
a8a6a916 125.Fn logl ,
8cecb502
JM
126.Fn log10 ,
127.Fn log10f ,
a8a6a916 128.Fn log10l ,
8cecb502
JM
129.Fn log2 ,
130.Fn log2f ,
a8a6a916 131.Fn log2l ,
8cecb502 132.Fn log1p ,
a8a6a916 133.Fn log1pf ,
8cecb502 134and
a8a6a916 135.Fn log1pl
8cecb502 136functions conform to
74dfd0cf 137.St -isoC-99 .