Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libcmath.tex @ 39042:c02fa187e0f4 legacy-trunk
Part of SF patch #1484695. This removes dead code. The chksum was
already verified in .frombuf() on the lines above. If there was
a problem an exception is raised, so there was no way this condition
could have been true.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Mon, 10 Jul 2006 00:23:17 +0000 |
| parents | 67f2190e1f6d |
| children | ebe52dbc3553 |
| rev | line source |
|---|---|
| 8918 | 1 \section{\module{cmath} --- |
|
10645
46788f16650b
Mark the references to module names use \module or \refmodule (the
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
2 Mathematical functions for complex numbers} |
|
46788f16650b
Mark the references to module names use \module or \refmodule (the
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
3 |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
4 \declaremodule{builtin}{cmath} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
5 \modulesynopsis{Mathematical functions for complex numbers.} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
6 |
|
10645
46788f16650b
Mark the references to module names use \module or \refmodule (the
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
7 This module is always available. It provides access to mathematical |
|
46788f16650b
Mark the references to module names use \module or \refmodule (the
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
8 functions for complex numbers. The functions are: |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
9 |
|
5809
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 \begin{funcdesc}{acos}{x} |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
11 Return the arc cosine of \var{x}. |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
12 There are two branch cuts: |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
13 One extends right from 1 along the real axis to \infinity, continuous |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
14 from below. |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
15 The other extends left from -1 along the real axis to -\infinity, |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
16 continuous from above. |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
17 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
18 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
19 \begin{funcdesc}{acosh}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
20 Return the hyperbolic arc cosine of \var{x}. |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
21 There is one branch cut, extending left from 1 along the real axis |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
22 to -\infinity, continuous from above. |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
23 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
24 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
25 \begin{funcdesc}{asin}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
26 Return the arc sine of \var{x}. |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
27 This has the same branch cuts as \function{acos()}. |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
28 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
29 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
30 \begin{funcdesc}{asinh}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
31 Return the hyperbolic arc sine of \var{x}. |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
32 There are two branch cuts, extending left from \plusminus\code{1j} to |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
33 \plusminus-\infinity\code{j}, both continuous from above. |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
34 These branch cuts should be considered a bug to be corrected in a |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
35 future release. |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
36 The correct branch cuts should extend along the imaginary axis, |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
37 one from \code{1j} up to \infinity\code{j} and continuous from the |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
38 right, and one from -\code{1j} down to -\infinity\code{j} and |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
39 continuous from the left. |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
40 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
41 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
42 \begin{funcdesc}{atan}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
43 Return the arc tangent of \var{x}. |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
44 There are two branch cuts: |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
45 One extends from \code{1j} along the imaginary axis to |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
46 \infinity\code{j}, continuous from the left. |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
47 The other extends from -\code{1j} along the imaginary axis to |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
48 -\infinity\code{j}, continuous from the left. |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
49 (This should probably be changed so the upper cut becomes continuous |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
50 from the other side.) |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
51 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
52 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
53 \begin{funcdesc}{atanh}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
54 Return the hyperbolic arc tangent of \var{x}. |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
55 There are two branch cuts: |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
56 One extends from 1 along the real axis to \infinity, continuous |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
57 from above. |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
58 The other extends from -1 along the real axis to -\infinity, |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
59 continuous from above. |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
60 (This should probably be changed so the right cut becomes continuous from |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
61 the other side.) |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
62 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
63 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
64 \begin{funcdesc}{cos}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
65 Return the cosine of \var{x}. |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
66 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
67 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
68 \begin{funcdesc}{cosh}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
69 Return the hyperbolic cosine of \var{x}. |
|
5809
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
70 \end{funcdesc} |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
71 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
72 \begin{funcdesc}{exp}{x} |
|
7246
193d704cbcc8
Replace $math$ with \code{}.
Guido van Rossum <guido@python.org>
parents:
7049
diff
changeset
|
73 Return the exponential value \code{e**\var{x}}. |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
74 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
75 |
|
32350
11c31a98dfd6
Patch #826074: cmath.log optional base argument, fixes #823209
Raymond Hettinger <python@rcn.com>
parents:
18232
diff
changeset
|
76 \begin{funcdesc}{log}{x\optional{, base}} |
|
11c31a98dfd6
Patch #826074: cmath.log optional base argument, fixes #823209
Raymond Hettinger <python@rcn.com>
parents:
18232
diff
changeset
|
77 Returns the logarithm of \var{x} to the given \var{base}. |
|
11c31a98dfd6
Patch #826074: cmath.log optional base argument, fixes #823209
Raymond Hettinger <python@rcn.com>
parents:
18232
diff
changeset
|
78 If the \var{base} is not specified, returns the natural logarithm of \var{x}. |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
79 There is one branch cut, from 0 along the negative real axis to |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
80 -\infinity, continuous from above. |
|
32350
11c31a98dfd6
Patch #826074: cmath.log optional base argument, fixes #823209
Raymond Hettinger <python@rcn.com>
parents:
18232
diff
changeset
|
81 \versionchanged[\var{base} argument added]{2.4} |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
82 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
83 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
84 \begin{funcdesc}{log10}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
85 Return the base-10 logarithm of \var{x}. |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
86 This has the same branch cut as \function{log()}. |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
87 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
88 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
89 \begin{funcdesc}{sin}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
90 Return the sine of \var{x}. |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
91 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
92 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
93 \begin{funcdesc}{sinh}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
94 Return the hyperbolic sine of \var{x}. |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
95 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
96 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
97 \begin{funcdesc}{sqrt}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
98 Return the square root of \var{x}. |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
99 This has the same branch cut as \function{log()}. |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
100 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
101 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
102 \begin{funcdesc}{tan}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
103 Return the tangent of \var{x}. |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
104 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
105 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
106 \begin{funcdesc}{tanh}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
107 Return the hyperbolic tangent of \var{x}. |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
108 \end{funcdesc} |
|
5809
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
109 |
|
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
110 The module also defines two mathematical constants: |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
111 |
|
5809
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
112 \begin{datadesc}{pi} |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
113 The mathematical constant \emph{pi}, as a real. |
|
5809
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
114 \end{datadesc} |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
115 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
116 \begin{datadesc}{e} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
117 The mathematical constant \emph{e}, as a real. |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
118 \end{datadesc} |
|
5809
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
119 |
|
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
120 Note that the selection of functions is similar, but not identical, to |
|
10645
46788f16650b
Mark the references to module names use \module or \refmodule (the
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
121 that in module \refmodule{math}\refbimodindex{math}. The reason for having |
| 11074 | 122 two modules is that some users aren't interested in complex numbers, |
|
7049
aece51362ada
Add index entry for reference to the math module.
Fred Drake <fdrake@acm.org>
parents:
6362
diff
changeset
|
123 and perhaps don't even know what they are. They would rather have |
|
aece51362ada
Add index entry for reference to the math module.
Fred Drake <fdrake@acm.org>
parents:
6362
diff
changeset
|
124 \code{math.sqrt(-1)} raise an exception than return a complex number. |
|
10645
46788f16650b
Mark the references to module names use \module or \refmodule (the
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
125 Also note that the functions defined in \module{cmath} always return a |
|
7049
aece51362ada
Add index entry for reference to the math module.
Fred Drake <fdrake@acm.org>
parents:
6362
diff
changeset
|
126 complex number, even if the answer can be expressed as a real number |
|
aece51362ada
Add index entry for reference to the math module.
Fred Drake <fdrake@acm.org>
parents:
6362
diff
changeset
|
127 (in which case the complex number has an imaginary part of zero). |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
128 |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
129 A note on branch cuts: They are curves along which the given function |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
130 fails to be continuous. They are a necessary feature of many complex |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
131 functions. It is assumed that if you need to compute with complex |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
132 functions, you will understand about branch cuts. Consult almost any |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
133 (not too elementary) book on complex variables for enlightenment. For |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
134 information of the proper choice of branch cuts for numerical |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
135 purposes, a good reference should be the following: |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
136 |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
137 \begin{seealso} |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
138 \seetext{Kahan, W: Branch cuts for complex elementary functions; |
|
34296
67f2190e1f6d
SF Patch #1093896: miscellaneous doc typos
Raymond Hettinger <python@rcn.com>
parents:
32350
diff
changeset
|
139 or, Much ado about nothing's sign bit. In Iserles, A., |
|
18232
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
140 and Powell, M. (eds.), \citetitle{The state of the art in |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
141 numerical analysis}. Clarendon Press (1987) pp165-211.} |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
142 \end{seealso} |
