File: Mathematical-Constants.html

package info (click to toggle)
octave3.2 3.2.4-8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 62,936 kB
  • ctags: 37,353
  • sloc: cpp: 219,497; fortran: 116,336; ansic: 10,264; sh: 5,508; makefile: 4,245; lex: 3,573; yacc: 3,062; objc: 2,042; lisp: 1,692; awk: 860; perl: 844
file content (277 lines) | stat: -rw-r--r-- 15,691 bytes parent folder | download
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<html lang="en">
<head>
<title>Mathematical Constants - 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="prev" href="Coordinate-Transformations.html#Coordinate-Transformations" title="Coordinate Transformations">
<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="Mathematical-Constants"></a>
Previous:&nbsp;<a rel="previous" accesskey="p" href="Coordinate-Transformations.html#Coordinate-Transformations">Coordinate Transformations</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Arithmetic.html#Arithmetic">Arithmetic</a>
<hr>
</div>

<h3 class="section">17.8 Mathematical Constants</h3>

<!-- data.cc -->
<p><a name="doc_002de"></a>

<div class="defun">
&mdash; Built-in Function:  <b>e</b><var><a name="index-e-1509"></a></var><br>
&mdash; Built-in Function:  <b>e</b> (<var>n</var>)<var><a name="index-e-1510"></a></var><br>
&mdash; Built-in Function:  <b>e</b> (<var>n, m</var>)<var><a name="index-e-1511"></a></var><br>
&mdash; Built-in Function:  <b>e</b> (<var>n, m, k, <small class="dots">...</small></var>)<var><a name="index-e-1512"></a></var><br>
&mdash; Built-in Function:  <b>e</b> (<var><small class="dots">...</small>, class</var>)<var><a name="index-e-1513"></a></var><br>
<blockquote><p>Return a scalar, matrix, or N-dimensional array whose elements are all equal
to the base of natural logarithms.  The constant
&lsquo;<samp><span class="samp">e</span></samp>&rsquo; satisfies the equation <code>log</code> (e) = 1.

        <p>When called with no arguments, return a scalar with the value e.  When
called with a single argument, return a square matrix with the dimension
specified.  When called with more than one scalar argument the first two
arguments are taken as the number of rows and columns and any further
arguments specify additional matrix dimensions. 
The optional argument <var>class</var> specifies the return type and may be
either "double" or "single". 
</p></blockquote></div>

<!-- data.cc -->
   <p><a name="doc_002dpi"></a>

<div class="defun">
&mdash; Built-in Function:  <b>pi</b><var><a name="index-pi-1514"></a></var><br>
&mdash; Built-in Function:  <b>pi</b> (<var>n</var>)<var><a name="index-pi-1515"></a></var><br>
&mdash; Built-in Function:  <b>pi</b> (<var>n, m</var>)<var><a name="index-pi-1516"></a></var><br>
&mdash; Built-in Function:  <b>pi</b> (<var>n, m, k, <small class="dots">...</small></var>)<var><a name="index-pi-1517"></a></var><br>
&mdash; Built-in Function:  <b>pi</b> (<var><small class="dots">...</small>, class</var>)<var><a name="index-pi-1518"></a></var><br>
<blockquote><p>Return a scalar, matrix, or N-dimensional array whose elements are all equal
to the ratio of the circumference of a circle to its
diameter. 
Internally, <code>pi</code> is computed as &lsquo;<samp><span class="samp">4.0 * atan (1.0)</span></samp>&rsquo;.

        <p>When called with no arguments, return a scalar with the value of
pi. 
When called with a single argument, return a square matrix with the dimension
specified.  When called with more than one scalar argument the first two
arguments are taken as the number of rows and columns and any further
arguments specify additional matrix dimensions. 
The optional argument <var>class</var> specifies the return type and may be
either "double" or "single". 
</p></blockquote></div>

<!-- data.cc -->
   <p><a name="doc_002dI"></a>

<div class="defun">
&mdash; Built-in Function:  <b>I</b><var><a name="index-I-1519"></a></var><br>
&mdash; Built-in Function:  <b>I</b> (<var>n</var>)<var><a name="index-I-1520"></a></var><br>
&mdash; Built-in Function:  <b>I</b> (<var>n, m</var>)<var><a name="index-I-1521"></a></var><br>
&mdash; Built-in Function:  <b>I</b> (<var>n, m, k, <small class="dots">...</small></var>)<var><a name="index-I-1522"></a></var><br>
&mdash; Built-in Function:  <b>I</b> (<var><small class="dots">...</small>, class</var>)<var><a name="index-I-1523"></a></var><br>
<blockquote><p>Return a scalar, matrix, or N-dimensional array whose elements are all equal
to the pure imaginary unit, defined as
<code>sqrt (-1)</code>. 
 I, and its equivalents i, J, and j, are functions so any of the names may
be reused for other purposes (such as i for a counter variable).

        <p>When called with no arguments, return a scalar with the value i.  When
called with a single argument, return a square matrix with the dimension
specified.  When called with more than one scalar argument the first two
arguments are taken as the number of rows and columns and any further
arguments specify additional matrix dimensions. 
The optional argument <var>class</var> specifies the return type and may be
either "double" or "single". 
</p></blockquote></div>

<!-- data.cc -->
   <p><a name="doc_002dInf"></a>

<div class="defun">
&mdash; Built-in Function:  <b>Inf</b><var><a name="index-Inf-1524"></a></var><br>
&mdash; Built-in Function:  <b>Inf</b> (<var>n</var>)<var><a name="index-Inf-1525"></a></var><br>
&mdash; Built-in Function:  <b>Inf</b> (<var>n, m</var>)<var><a name="index-Inf-1526"></a></var><br>
&mdash; Built-in Function:  <b>Inf</b> (<var>n, m, k, <small class="dots">...</small></var>)<var><a name="index-Inf-1527"></a></var><br>
&mdash; Built-in Function:  <b>Inf</b> (<var><small class="dots">...</small>, class</var>)<var><a name="index-Inf-1528"></a></var><br>
<blockquote><p>Return a scalar, matrix or N-dimensional array whose elements are all equal
to the IEEE representation for positive infinity.

        <p>Infinity is produced when results are too large to be represented using the
the IEEE floating point format for numbers.  Two common examples which
produce infinity are division by zero and overflow.
     <pre class="example">          [1/0 e^800]
          
          Inf   Inf
</pre>
        <p>When called with no arguments, return a scalar with the value &lsquo;<samp><span class="samp">Inf</span></samp>&rsquo;. 
When called with a single argument, return a square matrix with the dimension
specified.  When called with more than one scalar argument the first two
arguments are taken as the number of rows and columns and any further
arguments specify additional matrix dimensions. 
The optional argument <var>class</var> specifies the return type and may be
either "double" or "single". 
<!-- 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_002disinf.html#doc_002disinf">isinf</a>. 
</p></blockquote></div>

<!-- data.cc -->
   <p><a name="doc_002dNaN"></a>

<div class="defun">
&mdash; Built-in Function:  <b>NaN</b><var><a name="index-NaN-1529"></a></var><br>
&mdash; Built-in Function:  <b>NaN</b> (<var>n</var>)<var><a name="index-NaN-1530"></a></var><br>
&mdash; Built-in Function:  <b>NaN</b> (<var>n, m</var>)<var><a name="index-NaN-1531"></a></var><br>
&mdash; Built-in Function:  <b>NaN</b> (<var>n, m, k, <small class="dots">...</small></var>)<var><a name="index-NaN-1532"></a></var><br>
&mdash; Built-in Function:  <b>NaN</b> (<var><small class="dots">...</small>, class</var>)<var><a name="index-NaN-1533"></a></var><br>
<blockquote><p>Return a scalar, matrix, or N-dimensional array whose elements are all equal
to the IEEE symbol NaN (Not a Number). 
NaN is the result of operations which do not produce a well defined numerical
result.  Common operations which produce a NaN are arithmetic with infinity
(Inf - Inf), zero divided by zero (0/0),
and any operation involving another NaN value (5 + NaN).

        <p>Note that NaN always compares not equal to NaN (NaN != NaN).  This behavior
is specified by the IEEE standard for floating point arithmetic.  To
find NaN values, use the <code>isnan</code> function.

        <p>When called with no arguments, return a scalar with the value &lsquo;<samp><span class="samp">NaN</span></samp>&rsquo;. 
When called with a single argument, return a square matrix with the dimension
specified.  When called with more than one scalar argument the first two
arguments are taken as the number of rows and columns and any further
arguments specify additional matrix dimensions. 
The optional argument <var>class</var> specifies the return type and may be
either "double" or "single". 
<!-- 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_002disnan.html#doc_002disnan">isnan</a>. 
</p></blockquote></div>

<!-- data.cc -->
   <p><a name="doc_002deps"></a>

<div class="defun">
&mdash; Built-in Function:  <b>eps</b><var><a name="index-eps-1534"></a></var><br>
&mdash; Built-in Function:  <b>eps</b> (<var>x</var>)<var><a name="index-eps-1535"></a></var><br>
&mdash; Built-in Function:  <b>eps</b> (<var>n, m</var>)<var><a name="index-eps-1536"></a></var><br>
&mdash; Built-in Function:  <b>eps</b> (<var>n, m, k, <small class="dots">...</small></var>)<var><a name="index-eps-1537"></a></var><br>
&mdash; Built-in Function:  <b>eps</b> (<var><small class="dots">...</small>, class</var>)<var><a name="index-eps-1538"></a></var><br>
<blockquote><p>Return a scalar, matrix or N-dimensional array whose elements are all eps,
the machine precision.  More precisely, <code>eps</code> is the relative spacing
between any two adjacent numbers in the machine's floating point system. 
This number is obviously system dependent.  On machines that support IEEE
floating point arithmetic, <code>eps</code> is approximately
2.2204e-16 for double precision and 1.1921e-07
for single precision.

        <p>When called with no arguments, return a scalar with the value
<code>eps(1.0)</code>. 
Given a single argument <var>x</var>, return the distance between <var>x</var> and
the next largest value. 
When called with more than one argument the first two arguments are taken as
the number of rows and columns and any further
arguments specify additional matrix dimensions. 
The optional argument <var>class</var> specifies the return type and may be
either "double" or "single". 
</p></blockquote></div>

<!-- data.cc -->
   <p><a name="doc_002drealmax"></a>

<div class="defun">
&mdash; Built-in Function:  <b>realmax</b><var><a name="index-realmax-1539"></a></var><br>
&mdash; Built-in Function:  <b>realmax</b> (<var>n</var>)<var><a name="index-realmax-1540"></a></var><br>
&mdash; Built-in Function:  <b>realmax</b> (<var>n, m</var>)<var><a name="index-realmax-1541"></a></var><br>
&mdash; Built-in Function:  <b>realmax</b> (<var>n, m, k, <small class="dots">...</small></var>)<var><a name="index-realmax-1542"></a></var><br>
&mdash; Built-in Function:  <b>realmax</b> (<var><small class="dots">...</small>, class</var>)<var><a name="index-realmax-1543"></a></var><br>
<blockquote><p>Return a scalar, matrix or N-dimensional array whose elements are all equal
to the largest floating point number that is representable.  The actual
value is system dependent.  On machines that support IEEE
floating point arithmetic, <code>realmax</code> is approximately
1.7977e+308 for double precision and 3.4028e+38
for single precision.

        <p>When called with no arguments, return a scalar with the value
<code>realmax("double")</code>. 
When called with a single argument, return a square matrix with the dimension
specified.  When called with more than one scalar argument the first two
arguments are taken as the number of rows and columns and any further
arguments specify additional matrix dimensions. 
The optional argument <var>class</var> specifies the return type and may be
either "double" or "single". 
<!-- 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_002drealmin.html#doc_002drealmin">realmin</a>, <a href="doc_002dintmax.html#doc_002dintmax">intmax</a>, <a href="doc_002dbitmax.html#doc_002dbitmax">bitmax</a>. 
</p></blockquote></div>

<!-- data.cc -->
   <p><a name="doc_002drealmin"></a>

<div class="defun">
&mdash; Built-in Function:  <b>realmin</b><var><a name="index-realmin-1544"></a></var><br>
&mdash; Built-in Function:  <b>realmin</b> (<var>n</var>)<var><a name="index-realmin-1545"></a></var><br>
&mdash; Built-in Function:  <b>realmin</b> (<var>n, m</var>)<var><a name="index-realmin-1546"></a></var><br>
&mdash; Built-in Function:  <b>realmin</b> (<var>n, m, k, <small class="dots">...</small></var>)<var><a name="index-realmin-1547"></a></var><br>
&mdash; Built-in Function:  <b>realmin</b> (<var><small class="dots">...</small>, class</var>)<var><a name="index-realmin-1548"></a></var><br>
<blockquote><p>Return a scalar, matrix or N-dimensional array whose elements are all equal
to the smallest normalized floating point number that is representable. 
The actual value is system dependent.  On machines that support
IEEE floating point arithmetic, <code>realmin</code> is approximately
2.2251e-308 for double precision and 1.1755e-38
for single precision.

        <p>When called with no arguments, return a scalar with the value
<code>realmin("double")</code>. 
When called with a single argument, return a square matrix with the dimension
specified.  When called with more than one scalar argument the first two
arguments are taken as the number of rows and columns and any further
arguments specify additional matrix dimensions. 
The optional argument <var>class</var> specifies the return type and may be
either "double" or "single". 
<!-- 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_002drealmax.html#doc_002drealmax">realmax</a>, <a href="doc_002dintmin.html#doc_002dintmin">intmin</a>. 
</p></blockquote></div>

<!-- DO NOT EDIT!  Generated automatically by munge-texi. -->
<!-- Copyright (C) 1996, 1997, 2007, 2008, 2009 John W. Eaton -->
<!-- This file is part of Octave. -->
<!-- Octave is free software; you can redistribute it and/or modify it -->
<!-- under the terms of the GNU General Public License as published by the -->
<!-- Free Software Foundation; either version 3 of the License, or (at -->
<!-- your option) any later version. -->
<!-- Octave is distributed in the hope that it will be useful, but WITHOUT -->
<!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -->
<!-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License -->
<!-- for more details. -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with Octave; see the file COPYING.  If not, see -->
<!-- <http://www.gnu.org/licenses/>. -->
   </body></html>