Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
61f4d5f6
Commit
61f4d5f6
authored
Jul 17, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New cmath module docs, by AMK (with additions and deletions by Guido).
parent
8cbaa515
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
118 additions
and
0 deletions
+118
-0
Doc/lib/libcmath.tex
Doc/lib/libcmath.tex
+59
-0
Doc/libcmath.tex
Doc/libcmath.tex
+59
-0
No files found.
Doc/lib/libcmath.tex
0 → 100644
View file @
61f4d5f6
\section
{
Built-in Module
\sectcode
{
cmath
}}
\label
{
module-cmath
}
\bimodindex
{
cmath
}
\renewcommand
{
\indexsubitem
}{
(in module cmath)
}
This module is always available.
It provides access to mathematical functions for complex numbers.
The functions are:
\iftexi
\begin{funcdesc}
{
acos
}{
x
}
\funcline
{
asin
}{
x
}
\funcline
{
atan
}{
x
}
\funcline
{
cos
}{
x
}
\funcline
{
cosh
}{
x
}
\funcline
{
exp
}{
x
}
\funcline
{
log
}{
x
}
\funcline
{
log10
}{
x
}
\funcline
{
sin
}{
x
}
\funcline
{
sinh
}{
x
}
\funcline
{
sqrt
}{
x
}
\funcline
{
tan
}{
x
}
\funcline
{
tanh
}{
x
}
\end{funcdesc}
\else
\code
{
acos(
\varvars
{
x
}
)
}
,
\code
{
acosh(
\varvars
{
x
}
)
}
,
\code
{
asin(
\varvars
{
x
}
)
}
,
\code
{
asinh(
\varvars
{
x
}
)
}
,
\code
{
atan(
\varvars
{
x
}
)
}
,
\code
{
atanh(
\varvars
{
x
}
)
}
,
\code
{
cos(
\varvars
{
x
}
)
}
,
\code
{
cosh(
\varvars
{
x
}
)
}
,
\code
{
exp(
\varvars
{
x
}
)
}
,
\code
{
log(
\varvars
{
x
}
)
}
,
\code
{
log10(
\varvars
{
x
}
)
}
,
\code
{
sin(
\varvars
{
x
}
)
}
,
\code
{
sinh(
\varvars
{
x
}
)
}
,
\code
{
sqrt(
\varvars
{
x
}
)
}
,
\code
{
tan(
\varvars
{
x
}
)
}
,
\code
{
tanh(
\varvars
{
x
}
)
}
.
\fi
The module also defines two mathematical constants:
\iftexi
\begin{datadesc}
{
pi
}
\dataline
{
e
}
\end{datadesc}
\else
\code
{
pi
}
and
\code
{
e
}
.
\fi
Note that the selection of functions is similar, but not identical, to
that in module
\code
{
math
}
. The reason for having two modules is,
that some users aren't interested in complex numbers, and perhaps
don't even know what they are. They would rather have
\code
{
math(-1)
}
raise an exception than return a complex number. Also note that the
functions defined in
\code
{
cmath
}
always return a complex number, even
if the answer can be expressed as a real number (in which case the
complex number has an imaginary part of zero).
Doc/libcmath.tex
0 → 100644
View file @
61f4d5f6
\section
{
Built-in Module
\sectcode
{
cmath
}}
\label
{
module-cmath
}
\bimodindex
{
cmath
}
\renewcommand
{
\indexsubitem
}{
(in module cmath)
}
This module is always available.
It provides access to mathematical functions for complex numbers.
The functions are:
\iftexi
\begin{funcdesc}
{
acos
}{
x
}
\funcline
{
asin
}{
x
}
\funcline
{
atan
}{
x
}
\funcline
{
cos
}{
x
}
\funcline
{
cosh
}{
x
}
\funcline
{
exp
}{
x
}
\funcline
{
log
}{
x
}
\funcline
{
log10
}{
x
}
\funcline
{
sin
}{
x
}
\funcline
{
sinh
}{
x
}
\funcline
{
sqrt
}{
x
}
\funcline
{
tan
}{
x
}
\funcline
{
tanh
}{
x
}
\end{funcdesc}
\else
\code
{
acos(
\varvars
{
x
}
)
}
,
\code
{
acosh(
\varvars
{
x
}
)
}
,
\code
{
asin(
\varvars
{
x
}
)
}
,
\code
{
asinh(
\varvars
{
x
}
)
}
,
\code
{
atan(
\varvars
{
x
}
)
}
,
\code
{
atanh(
\varvars
{
x
}
)
}
,
\code
{
cos(
\varvars
{
x
}
)
}
,
\code
{
cosh(
\varvars
{
x
}
)
}
,
\code
{
exp(
\varvars
{
x
}
)
}
,
\code
{
log(
\varvars
{
x
}
)
}
,
\code
{
log10(
\varvars
{
x
}
)
}
,
\code
{
sin(
\varvars
{
x
}
)
}
,
\code
{
sinh(
\varvars
{
x
}
)
}
,
\code
{
sqrt(
\varvars
{
x
}
)
}
,
\code
{
tan(
\varvars
{
x
}
)
}
,
\code
{
tanh(
\varvars
{
x
}
)
}
.
\fi
The module also defines two mathematical constants:
\iftexi
\begin{datadesc}
{
pi
}
\dataline
{
e
}
\end{datadesc}
\else
\code
{
pi
}
and
\code
{
e
}
.
\fi
Note that the selection of functions is similar, but not identical, to
that in module
\code
{
math
}
. The reason for having two modules is,
that some users aren't interested in complex numbers, and perhaps
don't even know what they are. They would rather have
\code
{
math(-1)
}
raise an exception than return a complex number. Also note that the
functions defined in
\code
{
cmath
}
always return a complex number, even
if the answer can be expressed as a real number (in which case the
complex number has an imaginary part of zero).
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment