~ubuntu-branches/ubuntu/breezy/manpages-posix/breezy

« back to all changes in this revision

Viewing changes to man3p/log.3p

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2004-08-27 10:47:48 UTC
  • Revision ID: james.westby@ubuntu.com-20040827104748-8zjxz9vva0n0t4sm
Tags: 1.67-3
rules: linking manpages-posix not manpages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
 
2
.TH "LOG" P 2003 POSIX
 
3
.\" log 
 
4
.SH NAME
 
5
log, logf, logl \- natural logarithm function
 
6
.SH SYNOPSIS
 
7
.LP
 
8
\fB#include <math.h>
 
9
.br
 
10
.sp
 
11
double log(double\fP \fIx\fP\fB);
 
12
.br
 
13
float logf(float\fP \fIx\fP\fB);
 
14
.br
 
15
long double logl(long double\fP \fIx\fP\fB);
 
16
.br
 
17
\fP
 
18
.SH DESCRIPTION
 
19
.LP
 
20
These functions shall compute the natural logarithm of their argument
 
21
\fIx\fP,
 
22
log_\fIe\fP(\fIx\fP).
 
23
.LP
 
24
An application wishing to check for error situations should set \fIerrno\fP
 
25
to zero and call
 
26
\fIfeclearexcept\fP(FE_ALL_EXCEPT) before calling these functions.
 
27
On return, if \fIerrno\fP is non-zero or
 
28
\fIfetestexcept\fP(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW)
 
29
is non-zero, an error has occurred.
 
30
.SH RETURN VALUE
 
31
.LP
 
32
Upon successful completion, these functions shall return the natural
 
33
logarithm of \fIx\fP.
 
34
.LP
 
35
If \fIx\fP is \(+-0, a pole error shall occur and \fIlog\fP(), \fIlogf\fP(),
 
36
and \fIlogl\fP() shall return -HUGE_VAL,
 
37
-HUGE_VALF, and -HUGE_VALL, respectively.
 
38
.LP
 
39
For finite values of \fIx\fP that are less than 0,   \ or if \fIx\fP
 
40
is -Inf,  a domain error shall occur, and   \ either a NaN (if supported),
 
41
or  \ an implementation-defined value shall be returned.
 
42
.LP
 
43
If
 
44
\fIx\fP is NaN, a NaN shall be returned.
 
45
.LP
 
46
If \fIx\fP is 1, +0 shall be returned.
 
47
.LP
 
48
If \fIx\fP is +Inf, \fIx\fP shall be returned. 
 
49
.SH ERRORS
 
50
.LP
 
51
These functions shall fail if:
 
52
.TP 7
 
53
Domain\ Error
 
54
The finite value of \fIx\fP is negative,   \ or \fIx\fP is -Inf. 
 
55
.LP
 
56
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero,
 
57
then \fIerrno\fP shall be set to [EDOM]. If the
 
58
integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero,
 
59
then the invalid floating-point exception shall be
 
60
raised.
 
61
.TP 7
 
62
Pole\ Error
 
63
The value of \fIx\fP is zero. 
 
64
.LP
 
65
If the integer expression (math_errhandling & MATH_ERRNO) is non-zero,
 
66
then \fIerrno\fP shall be set to [ERANGE]. If the
 
67
integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero,
 
68
then the divide-by-zero floating-point exception shall be
 
69
raised.
 
70
.sp
 
71
.LP
 
72
\fIThe following sections are informative.\fP
 
73
.SH EXAMPLES
 
74
.LP
 
75
None.
 
76
.SH APPLICATION USAGE
 
77
.LP
 
78
On error, the expressions (math_errhandling & MATH_ERRNO) and (math_errhandling
 
79
& MATH_ERREXCEPT) are independent of
 
80
each other, but at least one of them must be non-zero.
 
81
.SH RATIONALE
 
82
.LP
 
83
None.
 
84
.SH FUTURE DIRECTIONS
 
85
.LP
 
86
None.
 
87
.SH SEE ALSO
 
88
.LP
 
89
\fIexp\fP() , \fIfeclearexcept\fP() , \fIfetestexcept\fP() , \fIisnan\fP()
 
90
, \fIlog10\fP() ,
 
91
\fIlog1p\fP() , the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
 
92
Section 4.18, Treatment of Error Conditions for Mathematical Functions,
 
93
\fI<math.h>\fP
 
94
.SH COPYRIGHT
 
95
Portions of this text are reprinted and reproduced in electronic form
 
96
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
 
97
-- Portable Operating System Interface (POSIX), The Open Group Base
 
98
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
 
99
Electrical and Electronics Engineers, Inc and The Open Group. In the
 
100
event of any discrepancy between this version and the original IEEE and
 
101
The Open Group Standard, the original IEEE and The Open Group Standard
 
102
is the referee document. The original Standard can be obtained online at
 
103
http://www.opengroup.org/unix/online.html .