1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
|
<html lang="en">
<head>
<title>Exponents and Logarithms - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Arithmetic.html#Arithmetic" title="Arithmetic">
<link rel="next" href="Complex-Arithmetic.html#Complex-Arithmetic" title="Complex Arithmetic">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Exponents-and-Logarithms"></a>
Next: <a rel="next" accesskey="n" href="Complex-Arithmetic.html#Complex-Arithmetic">Complex Arithmetic</a>,
Up: <a rel="up" accesskey="u" href="Arithmetic.html#Arithmetic">Arithmetic</a>
<hr>
</div>
<h3 class="section">17.1 Exponents and Logarithms</h3>
<!-- mappers.cc -->
<p><a name="doc_002dexp"></a>
<div class="defun">
— Mapping Function: <b>exp</b> (<var>x</var>)<var><a name="index-exp-1361"></a></var><br>
<blockquote><p>Compute
<code>e^x</code>
for each element of <var>x</var>. To compute the matrix
exponential, see <a href="Linear-Algebra.html#Linear-Algebra">Linear Algebra</a>.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dlog.html#doc_002dlog">log</a>.
</p></blockquote></div>
<!-- mappers.cc -->
<p><a name="doc_002dexpm1"></a>
<div class="defun">
— Mapping Function: <b>expm1</b> (<var>x</var>)<var><a name="index-expm1-1362"></a></var><br>
<blockquote><p>Compute
<code>exp (</code><var>x</var><code>) - 1</code>
accurately in the neighborhood of zero.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dexp.html#doc_002dexp">exp</a>.
</p></blockquote></div>
<!-- mappers.cc -->
<p><a name="doc_002dlog"></a>
<div class="defun">
— Mapping Function: <b>log</b> (<var>x</var>)<var><a name="index-log-1363"></a></var><br>
<blockquote><p>Compute the natural logarithm,
<code>ln (</code><var>x</var><code>)</code>,
for each element of <var>x</var>. To compute the
matrix logarithm, see <a href="Linear-Algebra.html#Linear-Algebra">Linear Algebra</a>.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dexp.html#doc_002dexp">exp</a>, <a href="doc_002dlog1p.html#doc_002dlog1p">log1p</a>, <a href="doc_002dlog2.html#doc_002dlog2">log2</a>, <a href="doc_002dlog10.html#doc_002dlog10">log10</a>, <a href="doc_002dlogspace.html#doc_002dlogspace">logspace</a>.
</p></blockquote></div>
<!-- mappers.cc -->
<p><a name="doc_002dlog1p"></a>
<div class="defun">
— Mapping Function: <b>log1p</b> (<var>x</var>)<var><a name="index-log1p-1364"></a></var><br>
<blockquote><p>Compute
<code>log (1 + </code><var>x</var><code>)</code>
accurately in the neighborhood of zero.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dlog.html#doc_002dlog">log</a>, <a href="doc_002dexp.html#doc_002dexp">exp</a>, <a href="doc_002dexpm1.html#doc_002dexpm1">expm1</a>.
</p></blockquote></div>
<!-- mappers.cc -->
<p><a name="doc_002dlog10"></a>
<div class="defun">
— Mapping Function: <b>log10</b> (<var>x</var>)<var><a name="index-log10-1365"></a></var><br>
<blockquote><p>Compute the base-10 logarithm of each element of <var>x</var>.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dlog.html#doc_002dlog">log</a>, <a href="doc_002dlog2.html#doc_002dlog2">log2</a>, <a href="doc_002dlogspace.html#doc_002dlogspace">logspace</a>, <a href="doc_002dexp.html#doc_002dexp">exp</a>.
</p></blockquote></div>
<!-- data.cc -->
<p><a name="doc_002dlog2"></a>
<div class="defun">
— Mapping Function: <b>log2</b> (<var>x</var>)<var><a name="index-log2-1366"></a></var><br>
— Mapping Function: [<var>f</var>, <var>e</var>] = <b>log2</b> (<var>x</var>)<var><a name="index-log2-1367"></a></var><br>
<blockquote><p>Compute the base-2 logarithm of each element of <var>x</var>.
<p>If called with two output arguments, split <var>x</var> into
binary mantissa and exponent so that
<code>1/2 <= abs(f) < 1</code>
and <var>e</var> is an integer. If
<code>x = 0</code>, <code>f = e = 0</code>.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dpow2.html#doc_002dpow2">pow2</a>, <a href="doc_002dlog.html#doc_002dlog">log</a>, <a href="doc_002dlog10.html#doc_002dlog10">log10</a>, <a href="doc_002dexp.html#doc_002dexp">exp</a>.
</p></blockquote></div>
<!-- ./general/nextpow2.m -->
<p><a name="doc_002dnextpow2"></a>
<div class="defun">
— Function File: <b>nextpow2</b> (<var>x</var>)<var><a name="index-nextpow2-1368"></a></var><br>
<blockquote><p>If <var>x</var> is a scalar, return the first integer <var>n</var> such that
2^n >= abs (x).
<p>If <var>x</var> is a vector, return <code>nextpow2 (length (</code><var>x</var><code>))</code>.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dpow2.html#doc_002dpow2">pow2</a>, <a href="doc_002dlog2.html#doc_002dlog2">log2</a>.
</p></blockquote></div>
<!-- ./general/nthroot.m -->
<p><a name="doc_002dnthroot"></a>
<div class="defun">
— Function File: <b>nthroot</b> (<var>x, n</var>)<var><a name="index-nthroot-1369"></a></var><br>
<blockquote>
<p>Compute the n-th root of <var>x</var>, returning real results for real
components of <var>x</var>. For example
<pre class="example"> nthroot (-1, 3)
-1
(-1) ^ (1 / 3)
0.50000 - 0.86603i
</pre>
</blockquote></div>
<!-- ./specfun/pow2.m -->
<p><a name="doc_002dpow2"></a>
<div class="defun">
— Mapping Function: <b>pow2</b> (<var>x</var>)<var><a name="index-pow2-1370"></a></var><br>
— Mapping Function: <b>pow2</b> (<var>f, e</var>)<var><a name="index-pow2-1371"></a></var><br>
<blockquote><p>With one argument, computes
2 .^ x
for each element of <var>x</var>.
<p>With two arguments, returns
f .* (2 .^ e).
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dlog2.html#doc_002dlog2">log2</a>, <a href="doc_002dnextpow2.html#doc_002dnextpow2">nextpow2</a>.
</p></blockquote></div>
<!-- ./specfun/reallog.m -->
<p><a name="doc_002dreallog"></a>
<div class="defun">
— Function File: <b>reallog</b> (<var>x</var>)<var><a name="index-reallog-1372"></a></var><br>
<blockquote><p>Return the real-valued natural logarithm of each element of <var>x</var>. Report
an error if any element results in a complex return value.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dlog.html#doc_002dlog">log</a>, <a href="doc_002drealpow.html#doc_002drealpow">realpow</a>, <a href="doc_002drealsqrt.html#doc_002drealsqrt">realsqrt</a>.
</p></blockquote></div>
<!-- ./specfun/realpow.m -->
<p><a name="doc_002drealpow"></a>
<div class="defun">
— Function File: <b>realpow</b> (<var>x, y</var>)<var><a name="index-realpow-1373"></a></var><br>
<blockquote><p>Compute the real-valued, element-by-element power operator. This is
equivalent to <var>x</var><code> .^ </code><var>y</var><!-- /@w -->, except that <code>realpow</code>
reports an error if any return value is complex.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dreallog.html#doc_002dreallog">reallog</a>, <a href="doc_002drealsqrt.html#doc_002drealsqrt">realsqrt</a>.
</p></blockquote></div>
<!-- ./specfun/realsqrt.m -->
<p><a name="doc_002drealsqrt"></a>
<div class="defun">
— Function File: <b>realsqrt</b> (<var>x</var>)<var><a name="index-realsqrt-1374"></a></var><br>
<blockquote><p>Return the real-valued square root of each element of <var>x</var>. Report an
error if any element results in a complex return value.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002dsqrt.html#doc_002dsqrt">sqrt</a>, <a href="doc_002drealpow.html#doc_002drealpow">realpow</a>, <a href="doc_002dreallog.html#doc_002dreallog">reallog</a>.
</p></blockquote></div>
<!-- mappers.cc -->
<p><a name="doc_002dsqrt"></a>
<div class="defun">
— Mapping Function: <b>sqrt</b> (<var>x</var>)<var><a name="index-sqrt-1375"></a></var><br>
<blockquote><p>Compute the square root of each element of <var>x</var>. If <var>x</var> is negative,
a complex result is returned. To compute the matrix square root, see
<a href="Linear-Algebra.html#Linear-Algebra">Linear Algebra</a>.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002drealsqrt.html#doc_002drealsqrt">realsqrt</a>.
</p></blockquote></div>
</body></html>
|