Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libmath.tex @ 10123:bc287c6cfa23 legacy-trunk
Restructured a bit.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 08 Feb 1999 22:27:18 +0000 |
| parents | 8483953a9248 |
| children | e09f19441136 |
| rev | line source |
|---|---|
| 8918 | 1 \section{\module{math} --- |
| 2 Mathematical functions (\function{sin()} etc.).} | |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
3 \declaremodule{builtin}{math} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
4 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
5 |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
7877
diff
changeset
|
6 \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
|
7 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 This module is always available. |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
9 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
|
10 standard. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 They are: |
| 6363 | 12 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 \begin{funcdesc}{acos}{x} |
| 6363 | 14 Return the arc cosine of \var{x}. |
| 15 \end{funcdesc} | |
| 16 | |
| 17 \begin{funcdesc}{asin}{x} | |
| 18 Return the arc sine of \var{x}. | |
| 19 \end{funcdesc} | |
| 20 | |
| 21 \begin{funcdesc}{atan}{x} | |
| 22 Return the arc tangent of \var{x}. | |
| 23 \end{funcdesc} | |
| 24 | |
|
9607
8483953a9248
Rename the parameters of atan2(), based on comments from Guido & Peter
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
25 \begin{funcdesc}{atan2}{y, x} |
|
8483953a9248
Rename the parameters of atan2(), based on comments from Guido & Peter
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
26 Return \code{atan(\var{y} / \var{x})}. |
| 6363 | 27 \end{funcdesc} |
| 28 | |
| 29 \begin{funcdesc}{ceil}{x} | |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
30 Return the ceiling of \var{x} as a real. |
| 6363 | 31 \end{funcdesc} |
| 32 | |
| 33 \begin{funcdesc}{cos}{x} | |
| 34 Return the cosine of \var{x}. | |
| 35 \end{funcdesc} | |
| 36 | |
| 37 \begin{funcdesc}{cosh}{x} | |
| 38 Return the hyperbolic cosine of \var{x}. | |
| 39 \end{funcdesc} | |
| 40 | |
| 41 \begin{funcdesc}{exp}{x} | |
|
6647
a7ea74a27993
Get rid of math mode in some places.
Guido van Rossum <guido@python.org>
parents:
6485
diff
changeset
|
42 Return \code{e**\var{x}}. |
| 6363 | 43 \end{funcdesc} |
| 44 | |
| 45 \begin{funcdesc}{fabs}{x} | |
| 46 Return the absolute value of the real \var{x}. | |
| 47 \end{funcdesc} | |
| 48 | |
| 49 \begin{funcdesc}{floor}{x} | |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
50 Return the floor of \var{x} as a real. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
51 \end{funcdesc} |
| 6363 | 52 |
| 53 \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
|
54 Return \code{\var{x} \%\ \var{y}}. |
| 6363 | 55 \end{funcdesc} |
| 56 | |
| 57 \begin{funcdesc}{frexp}{x} | |
| 58 Return the matissa and exponent for \var{x}. The mantissa is | |
| 59 positive. | |
| 60 \end{funcdesc} | |
| 61 | |
| 62 \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
|
63 Return the Euclidean distance, \code{sqrt(\var{x}*\var{x} + \var{y}*\var{y})}. |
| 6363 | 64 \end{funcdesc} |
| 65 | |
| 66 \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
|
67 Return \code{\var{x} * (2**\var{i})}. |
| 6363 | 68 \end{funcdesc} |
| 69 | |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
70 \begin{funcdesc}{log}{x} |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
71 Return the natural logarithm of \var{x}. |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
72 \end{funcdesc} |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
73 |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
74 \begin{funcdesc}{log10}{x} |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
75 Return the base-10 logarithm of \var{x}. |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
76 \end{funcdesc} |
|
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
77 |
| 6363 | 78 \begin{funcdesc}{modf}{x} |
| 79 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
|
80 carry the sign of \var{x}. The integer part is returned as a real. |
| 6363 | 81 \end{funcdesc} |
| 82 | |
| 83 \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
|
84 Return \code{\var{x}**\var{y}}. |
| 6363 | 85 \end{funcdesc} |
| 86 | |
| 87 \begin{funcdesc}{sin}{x} | |
| 88 Return the sine of \var{x}. | |
| 89 \end{funcdesc} | |
| 90 | |
| 91 \begin{funcdesc}{sinh}{x} | |
| 92 Return the hyperbolic sine of \var{x}. | |
| 93 \end{funcdesc} | |
| 94 | |
| 95 \begin{funcdesc}{sqrt}{x} | |
| 96 Return the square root of \var{x}. | |
| 97 \end{funcdesc} | |
| 98 | |
| 99 \begin{funcdesc}{tan}{x} | |
| 100 Return the tangent of \var{x}. | |
| 101 \end{funcdesc} | |
| 102 | |
| 103 \begin{funcdesc}{tanh}{x} | |
| 104 Return the hyperbolic tangent of \var{x}. | |
| 105 \end{funcdesc} | |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
106 |
|
7157
a6fa9f3cad13
Added descriptions for log() and log10().
Fred Drake <fdrake@acm.org>
parents:
7048
diff
changeset
|
107 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
|
108 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
|
109 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
|
110 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
|
111 thing in Python). |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
112 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
113 The module also defines two mathematical constants: |
| 6363 | 114 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
115 \begin{datadesc}{pi} |
| 6363 | 116 The mathematical constant \emph{pi}. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
117 \end{datadesc} |
| 5818 | 118 |
| 6363 | 119 \begin{datadesc}{e} |
| 120 The mathematical constant \emph{e}. | |
| 121 \end{datadesc} | |
| 122 | |
|
6485
2f258162aae2
Restore the \seealso formatting that got lost when I updated the math
Fred Drake <fdrake@acm.org>
parents:
6363
diff
changeset
|
123 \begin{seealso} |
|
2f258162aae2
Restore the \seealso formatting that got lost when I updated the math
Fred Drake <fdrake@acm.org>
parents:
6363
diff
changeset
|
124 \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
|
125 \end{seealso} |
