Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 14a8024

Browse files
committed
New cmath module docs, by AMK (with additions and deletions by Guido).
1 parent 6c9db41 commit 14a8024

2 files changed

Lines changed: 118 additions & 0 deletions

File tree

Doc/lib/libcmath.tex

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
\section{Built-in Module \sectcode{cmath}}
2+
\label{module-cmath}
3+
4+
\bimodindex{cmath}
5+
\renewcommand{\indexsubitem}{(in module cmath)}
6+
This module is always available.
7+
It provides access to mathematical functions for complex numbers.
8+
The functions are:
9+
\iftexi
10+
\begin{funcdesc}{acos}{x}
11+
\funcline{asin}{x}
12+
\funcline{atan}{x}
13+
\funcline{cos}{x}
14+
\funcline{cosh}{x}
15+
\funcline{exp}{x}
16+
\funcline{log}{x}
17+
\funcline{log10}{x}
18+
\funcline{sin}{x}
19+
\funcline{sinh}{x}
20+
\funcline{sqrt}{x}
21+
\funcline{tan}{x}
22+
\funcline{tanh}{x}
23+
\end{funcdesc}
24+
\else
25+
\code{acos(\varvars{x})},
26+
\code{acosh(\varvars{x})},
27+
\code{asin(\varvars{x})},
28+
\code{asinh(\varvars{x})},
29+
\code{atan(\varvars{x})},
30+
\code{atanh(\varvars{x})},
31+
\code{cos(\varvars{x})},
32+
\code{cosh(\varvars{x})},
33+
\code{exp(\varvars{x})},
34+
\code{log(\varvars{x})},
35+
\code{log10(\varvars{x})},
36+
\code{sin(\varvars{x})},
37+
\code{sinh(\varvars{x})},
38+
\code{sqrt(\varvars{x})},
39+
\code{tan(\varvars{x})},
40+
\code{tanh(\varvars{x})}.
41+
\fi
42+
43+
The module also defines two mathematical constants:
44+
\iftexi
45+
\begin{datadesc}{pi}
46+
\dataline{e}
47+
\end{datadesc}
48+
\else
49+
\code{pi} and \code{e}.
50+
\fi
51+
52+
Note that the selection of functions is similar, but not identical, to
53+
that in module \code{math}. The reason for having two modules is,
54+
that some users aren't interested in complex numbers, and perhaps
55+
don't even know what they are. They would rather have \code{math(-1)}
56+
raise an exception than return a complex number. Also note that the
57+
functions defined in \code{cmath} always return a complex number, even
58+
if the answer can be expressed as a real number (in which case the
59+
complex number has an imaginary part of zero).

Doc/libcmath.tex

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
\section{Built-in Module \sectcode{cmath}}
2+
\label{module-cmath}
3+
4+
\bimodindex{cmath}
5+
\renewcommand{\indexsubitem}{(in module cmath)}
6+
This module is always available.
7+
It provides access to mathematical functions for complex numbers.
8+
The functions are:
9+
\iftexi
10+
\begin{funcdesc}{acos}{x}
11+
\funcline{asin}{x}
12+
\funcline{atan}{x}
13+
\funcline{cos}{x}
14+
\funcline{cosh}{x}
15+
\funcline{exp}{x}
16+
\funcline{log}{x}
17+
\funcline{log10}{x}
18+
\funcline{sin}{x}
19+
\funcline{sinh}{x}
20+
\funcline{sqrt}{x}
21+
\funcline{tan}{x}
22+
\funcline{tanh}{x}
23+
\end{funcdesc}
24+
\else
25+
\code{acos(\varvars{x})},
26+
\code{acosh(\varvars{x})},
27+
\code{asin(\varvars{x})},
28+
\code{asinh(\varvars{x})},
29+
\code{atan(\varvars{x})},
30+
\code{atanh(\varvars{x})},
31+
\code{cos(\varvars{x})},
32+
\code{cosh(\varvars{x})},
33+
\code{exp(\varvars{x})},
34+
\code{log(\varvars{x})},
35+
\code{log10(\varvars{x})},
36+
\code{sin(\varvars{x})},
37+
\code{sinh(\varvars{x})},
38+
\code{sqrt(\varvars{x})},
39+
\code{tan(\varvars{x})},
40+
\code{tanh(\varvars{x})}.
41+
\fi
42+
43+
The module also defines two mathematical constants:
44+
\iftexi
45+
\begin{datadesc}{pi}
46+
\dataline{e}
47+
\end{datadesc}
48+
\else
49+
\code{pi} and \code{e}.
50+
\fi
51+
52+
Note that the selection of functions is similar, but not identical, to
53+
that in module \code{math}. The reason for having two modules is,
54+
that some users aren't interested in complex numbers, and perhaps
55+
don't even know what they are. They would rather have \code{math(-1)}
56+
raise an exception than return a complex number. Also note that the
57+
functions defined in \code{cmath} always return a complex number, even
58+
if the answer can be expressed as a real number (in which case the
59+
complex number has an imaginary part of zero).

0 commit comments

Comments
 (0)