Skip to content

Commit 8bed954

Browse files
committed
Merge pull request #589 from tkoeppe/imagine
[complex] Clarify the return value range of log(x)
2 parents cc003c2 + b1f17ea commit 8bed954

File tree

1 file changed

+25
-31
lines changed

1 file changed

+25
-31
lines changed

source/numerics.tex

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
template<class T> T norm(const complex<T>&);
308308

309309
template<class T> complex<T> conj(const complex<T>&);
310-
template <class T> complex<T> proj(const complex<T>&);
310+
template<class T> complex<T> proj(const complex<T>&);
311311
template<class T> complex<T> polar(const T&, const T& = 0);
312312

313313
// \ref{complex.transcendentals}, transcendentals:
@@ -325,9 +325,9 @@
325325
template<class T> complex<T> log (const complex<T>&);
326326
template<class T> complex<T> log10(const complex<T>&);
327327

328-
template<class T> complex<T> pow(const complex<T>&, const T&);
329-
template<class T> complex<T> pow(const complex<T>&, const complex<T>&);
330-
template<class T> complex<T> pow(const T&, const complex<T>&);
328+
template<class T> complex<T> pow (const complex<T>&, const T&);
329+
template<class T> complex<T> pow (const complex<T>&, const complex<T>&);
330+
template<class T> complex<T> pow (const T&, const complex<T>&);
331331

332332
template<class T> complex<T> sin (const complex<T>&);
333333
template<class T> complex<T> sinh (const complex<T>&);
@@ -1119,7 +1119,7 @@
11191119
\begin{itemdescr}
11201120
\pnum
11211121
\returns
1122-
The complex base e exponential of \tcode{x}.
1122+
The complex base-$e$ exponential of \tcode{x}.
11231123
\end{itemdescr}
11241124

11251125
\indexlibrary{\idxcode{log}!\idxcode{complex}}%
@@ -1130,18 +1130,13 @@
11301130
\begin{itemdescr}
11311131
\pnum
11321132
\notes
1133-
the branch cuts are along the negative real axis.
1133+
The branch cuts are along the negative real axis.
11341134

11351135
\pnum
11361136
\returns
1137-
The complex natural (base e) logarithm of \tcode{x},
1138-
in the range of a strip mathematically unbounded along the
1139-
real axis and in the interval \crange{-i times pi}{i times pi}
1140-
along the imaginary axis.
1141-
When \tcode{x} is a negative real
1142-
number,
1143-
\tcode{imag(log(x))}
1144-
is pi.
1137+
The complex natural (base-$e$) logarithm of \tcode{x}. For all \tcode{x},
1138+
\tcode{imag(log(x))} lies in the interval \crange{$-\pi$}{$\pi$}, and
1139+
when \tcode{x} is a negative real number, \tcode{imag(log(x))} is $\pi$.
11451140
\end{itemdescr}
11461141

11471142
\indexlibrary{\idxcode{log10}!\idxcode{complex}}%
@@ -1152,40 +1147,39 @@
11521147
\begin{itemdescr}
11531148
\pnum
11541149
\notes
1155-
the branch cuts are along the negative real axis.
1150+
The branch cuts are along the negative real axis.
11561151

11571152
\pnum
11581153
\returns
1159-
The complex common (base 10) logarithm of \tcode{x}, defined as
1160-
\tcode{log(x)/log(10)}.
1154+
The complex common (base-$10$) logarithm of \tcode{x}, defined as
1155+
\tcode{log(x) / log(10)}.
11611156
\end{itemdescr}
11621157

11631158
\indexlibrary{\idxcode{pow}!\idxcode{complex}}%
11641159
\begin{itemdecl}
1165-
template<class T>
1166-
complex<T> pow(const complex<T>& x, const complex<T>& y);
1167-
template<class T> complex<T> pow (const complex<T>& x, const T& y);
1168-
template<class T> complex<T> pow (const T& x, const complex<T>& y);
1160+
template<class T> complex<T> pow(const complex<T>& x, const complex<T>& y);
1161+
template<class T> complex<T> pow(const complex<T>& x, const T& y);
1162+
template<class T> complex<T> pow(const T& x, const complex<T>& y);
11691163
\end{itemdecl}
11701164

11711165
\begin{itemdescr}
11721166
\pnum
11731167
\notes
1174-
the branch cuts are along the negative real axis.
1168+
The branch cuts are along the negative real axis.
11751169

11761170
\pnum
11771171
\returns
1178-
The complex power of base \tcode{x} raised to the \tcode{y}-th power,
1172+
The complex power of base \tcode{x} raised to the \tcode{y}$^\text{th}$ power,
11791173
defined as
1180-
\tcode{exp(y*log(x))}.
1174+
\tcode{exp(y * log(x))}.
11811175
The value returned for
1182-
\tcode{pow(0,0)}
1176+
\tcode{pow(0, 0)}
11831177
is implementation-defined.
11841178
\end{itemdescr}
11851179

11861180
\indexlibrary{\idxcode{sin}!\idxcode{complex}}%
11871181
\begin{itemdecl}
1188-
template<class T> complex<T> sin (const complex<T>& x);
1182+
template<class T> complex<T> sin(const complex<T>& x);
11891183
\end{itemdecl}
11901184

11911185
\begin{itemdescr}
@@ -1196,7 +1190,7 @@
11961190

11971191
\indexlibrary{\idxcode{sinh}!\idxcode{complex}}%
11981192
\begin{itemdecl}
1199-
template<class T> complex<T> sinh (const complex<T>& x);
1193+
template<class T> complex<T> sinh(const complex<T>& x);
12001194
\end{itemdecl}
12011195

12021196
\begin{itemdescr}
@@ -1207,13 +1201,13 @@
12071201

12081202
\indexlibrary{\idxcode{sqrt}!\idxcode{complex}}%
12091203
\begin{itemdecl}
1210-
template<class T> complex<T> sqrt (const complex<T>& x);
1204+
template<class T> complex<T> sqrt(const complex<T>& x);
12111205
\end{itemdecl}
12121206

12131207
\begin{itemdescr}
12141208
\pnum
12151209
\notes
1216-
the branch cuts are along the negative real axis.
1210+
The branch cuts are along the negative real axis.
12171211

12181212
\pnum
12191213
\returns
@@ -1225,7 +1219,7 @@
12251219

12261220
\indexlibrary{\idxcode{tan}!\idxcode{complex}}%
12271221
\begin{itemdecl}
1228-
template<class T> complex<T> tan (const complex<T>& x);
1222+
template<class T> complex<T> tan(const complex<T>& x);
12291223
\end{itemdecl}
12301224

12311225
\begin{itemdescr}
@@ -1236,7 +1230,7 @@
12361230

12371231
\indexlibrary{\idxcode{tanh}!\idxcode{complex}}%
12381232
\begin{itemdecl}
1239-
template<class T> complex<T> tanh (const complex<T>& x);
1233+
template<class T> complex<T> tanh(const complex<T>& x);
12401234
\end{itemdecl}
12411235

12421236
\begin{itemdescr}

0 commit comments

Comments
 (0)