Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libcmath.tex @ 25838:8540887bcec6 2.2
Backport of 2.183:
Fix memory leak in add_subclass() found by NealN with valgrind.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 18 Oct 2002 13:42:21 +0000 |
| parents | d923b3c8b152 |
| children | 11c31a98dfd6 |
| 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 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
76 \begin{funcdesc}{log}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
77 Return 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
|
78 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
|
79 -\infinity, continuous from above. |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
80 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
81 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
82 \begin{funcdesc}{log10}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
83 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
|
84 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
|
85 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
86 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
87 \begin{funcdesc}{sin}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
88 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
|
89 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
90 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
91 \begin{funcdesc}{sinh}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
92 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
|
93 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
94 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
95 \begin{funcdesc}{sqrt}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
96 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
|
97 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
|
98 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
99 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
100 \begin{funcdesc}{tan}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
101 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
|
102 \end{funcdesc} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
103 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
104 \begin{funcdesc}{tanh}{x} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
105 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
|
106 \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
|
107 |
|
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
108 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
|
109 |
|
5809
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
110 \begin{datadesc}{pi} |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
111 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
|
112 \end{datadesc} |
|
6362
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
113 |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
114 \begin{datadesc}{e} |
|
32663267eb40
Fixed up formatting, added descriptions for previously undocumented functions.
Fred Drake <fdrake@acm.org>
parents:
5810
diff
changeset
|
115 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
|
116 \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
|
117 |
|
5120ea86b25d
New cmath module docs, by AMK (with additions and deletions by Guido).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
118 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
|
119 that in module \refmodule{math}\refbimodindex{math}. The reason for having |
| 11074 | 120 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
|
121 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
|
122 \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
|
123 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
|
124 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
|
125 (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
|
126 |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
127 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
|
128 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
|
129 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
|
130 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
|
131 (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
|
132 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
|
133 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
|
134 |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
135 \begin{seealso} |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
136 \seetext{Kahan, W: Branch cuts for complex elementary functions; |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
137 or, Much ado about nothings's sign bit. In Iserles, A., |
|
d923b3c8b152
Contributed updates from Harald Hanche-Olsen, giving details of the branch
Fred Drake <fdrake@acm.org>
parents:
11074
diff
changeset
|
138 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
|
139 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
|
140 \end{seealso} |
