Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libmath.tex @ 8831:00a6bb65ff29 legacy-trunk
Getting rid of this ancient stuff.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 05 Aug 1998 21:10:09 +0000 |
| parents | 760dcf197048 |
| children | acfffe14628e |
| rev | line source |
|---|---|
|
7877
8e5223680a9d
Remove all uses of \sectcode; we can now use logical markup everywhere.
Fred Drake <fdrake@acm.org>
parents:
7863
diff
changeset
|
1 \section{Built-in Module \module{math}} |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
2 \declaremodule{builtin}{math} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
3 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
4 |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
5 \modulesynopsis{Mathematical functions (\function{sin()} etc.).} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
6 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
7 This module is always available. |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
8 It provides access to the mathematical functions defined by the \C{} |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
9 standard. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 They are: |
| 6363 | 11 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 \begin{funcdesc}{acos}{x} |
| 6363 | 13 Return the arc cosine of \var{x}. |
| 14 \end{funcdesc} | |
| 15 | |
| 16 \begin{funcdesc}{asin}{x} | |
| 17 Return the arc sine of \var{x}. | |
| 18 \end{funcdesc} | |
| 19 | |
| 20 \begin{funcdesc}{atan}{x} | |
| 21 Return the arc tangent of \var{x}. | |
| 22 \end{funcdesc} | |
| 23 | |
| 24 \begin{funcdesc}{atan2}{x, y} | |
|
7048
3eca5f37501a
Typographical nits: Always set parameter names in \var{} in the running text.
Fred Drake <fdrake@acm.org>
parents:
6647
diff
changeset
|
25 Return \code{atan(\var{x} / \var{y})}. |
| 6363 | 26 \end{funcdesc} |
| 27 | |
| 28 \begin{funcdesc}{ceil}{x} | |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
29 Return the ceiling of \var{x} as a real. |
| 6363 | 30 \end{funcdesc} |
| 31 | |
| 32 \begin{funcdesc}{cos}{x} | |
| 33 Return the cosine of \var{x}. | |
| 34 \end{funcdesc} | |
| 35 | |
| 36 \begin{funcdesc}{cosh}{x} | |
| 37 Return the hyperbolic cosine of \var{x}. | |
| 38 \end{funcdesc} | |
| 39 | |
| 40 \begin{funcdesc}{exp}{x} | |
|
6647
a7ea74a27993
Get rid of math mode in some places.
Guido van Rossum <guido@python.org>
parents:
6485
diff
changeset
|
41 Return \code{e**\var{x}}. |
| 6363 | 42 \end{funcdesc} |
| 43 | |
| 44 \begin{funcdesc}{fabs}{x} | |
| 45 Return the absolute value of the real \var{x}. | |
| 46 \end{funcdesc} | |
| 47 | |
| 48 \begin{funcdesc}{floor}{x} | |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
49 Return the floor of \var{x} as a real. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
50 \end{funcdesc} |
| 6363 | 51 |
| 52 \begin{funcdesc}{fmod}{x, y} | |
|
7048
3eca5f37501a
Typographical nits: Always set parameter names in \var{} in the running text.
Fred Drake <fdrake@acm.org>
parents:
6647
diff
changeset
|
53 Return \code{\var{x} \%\ \var{y}}. |
| 6363 | 54 \end{funcdesc} |
| 55 | |
| 56 \begin{funcdesc}{frexp}{x} | |
| 57 Return the matissa and exponent for \var{x}. The mantissa is | |
| 58 positive. | |
| 59 \end{funcdesc} | |
| 60 | |
| 61 \begin{funcdesc}{hypot}{x, y} | |
|
7048
3eca5f37501a
Typographical nits: Always set parameter names in \var{} in the running text.
Fred Drake <fdrake@acm.org>
parents:
6647
diff
changeset
|
62 Return the Euclidean distance, \code{sqrt(\var{x}*\var{x} + \var{y}*\var{y})}. |
| 6363 | 63 \end{funcdesc} |
| 64 | |
| 65 \begin{funcdesc}{ldexp}{x, i} | |
|
6647
a7ea74a27993
Get rid of math mode in some places.
Guido van Rossum <guido@python.org>
parents:
6485
diff
changeset
|
66 Return \code{\var{x} * (2**\var{i})}. |
| 6363 | 67 \end{funcdesc} |
| 68 | |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
69 \begin{funcdesc}{log}{x} |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
70 Return the natural logarithm of \var{x}. |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
71 \end{funcdesc} |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
72 |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
73 \begin{funcdesc}{log10}{x} |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
74 Return the base-10 logarithm of \var{x}. |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
75 \end{funcdesc} |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
76 |
| 6363 | 77 \begin{funcdesc}{modf}{x} |
| 78 Return the fractional and integer parts of \var{x}. Both results | |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
79 carry the sign of \var{x}. The integer part is returned as a real. |
| 6363 | 80 \end{funcdesc} |
| 81 | |
| 82 \begin{funcdesc}{pow}{x, y} | |
|
6647
a7ea74a27993
Get rid of math mode in some places.
Guido van Rossum <guido@python.org>
parents:
6485
diff
changeset
|
83 Return \code{\var{x}**\var{y}}. |
| 6363 | 84 \end{funcdesc} |
| 85 | |
| 86 \begin{funcdesc}{sin}{x} | |
| 87 Return the sine of \var{x}. | |
| 88 \end{funcdesc} | |
| 89 | |
| 90 \begin{funcdesc}{sinh}{x} | |
| 91 Return the hyperbolic sine of \var{x}. | |
| 92 \end{funcdesc} | |
| 93 | |
| 94 \begin{funcdesc}{sqrt}{x} | |
| 95 Return the square root of \var{x}. | |
| 96 \end{funcdesc} | |
| 97 | |
| 98 \begin{funcdesc}{tan}{x} | |
| 99 Return the tangent of \var{x}. | |
| 100 \end{funcdesc} | |
| 101 | |
| 102 \begin{funcdesc}{tanh}{x} | |
| 103 Return the hyperbolic tangent of \var{x}. | |
| 104 \end{funcdesc} | |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
105 |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
106 Note that \function{frexp()} and \function{modf()} have a different |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
107 call/return pattern than their \C{} equivalents: they take a single |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
108 argument and return a pair of values, rather than returning their |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
109 second return value through an `output parameter' (there is no such |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
110 thing in Python). |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
111 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
112 The module also defines two mathematical constants: |
| 6363 | 113 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
114 \begin{datadesc}{pi} |
| 6363 | 115 The mathematical constant \emph{pi}. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
116 \end{datadesc} |
| 5818 | 117 |
| 6363 | 118 \begin{datadesc}{e} |
| 119 The mathematical constant \emph{e}. | |
| 120 \end{datadesc} | |
| 121 | |
|
6485
2f258162aae2
Restore the \seealso formatting that got lost when I updated the math
Fred Drake <fdrake@acm.org>
parents:
6363
diff
changeset
|
122 \begin{seealso} |
|
2f258162aae2
Restore the \seealso formatting that got lost when I updated the math
Fred Drake <fdrake@acm.org>
parents:
6363
diff
changeset
|
123 \seemodule{cmath}{Complex number versions of many of these functions.} |
|
2f258162aae2
Restore the \seealso formatting that got lost when I updated the math
Fred Drake <fdrake@acm.org>
parents:
6363
diff
changeset
|
124 \end{seealso} |
