Update docs to match implementation of $build_and_dump_html_index
[maxima.git] / doc / info / Constants.texi.m4
blob05970454c0c85f6135af55998f998791081568fd
1 @c -*- mode: texinfo -*-
2 @c -----------------------------------------------------------------------------
3 @page
4 @node Constants, Lists, Strings, Data Types and Structures
5 @section Constants
6 @c -----------------------------------------------------------------------------
8 @menu
9 * Functions and Variables for Constants::
10 @end menu
12 @c -----------------------------------------------------------------------------
13 @node Functions and Variables for Constants,  , Constants, Constants
14 @subsection Functions and Variables for Constants
15 @c -----------------------------------------------------------------------------
17 @c -----------------------------------------------------------------------------
18 @anchor{%catalan}
19 @defvr {Constant} %catalan
20 @vrindex catalan
21 @vrindex Catalan's Constant
23 @code{%catalan} represents Catalan's constant, @math{G}, defined by
24 m4_displaymath(
25 <<<G = \sum_{n=0}^\infty {(-1)^n\over (2n+1)^2}>>>,
26 <<<
27 @example
28                                inf
29                                ____         n
30                                ╲       (- 1)
31                     %catalan =  ⟩    ──────────
32                                ╱              2
33                                ‾‾‾‾  (2 n + 1)
34                                n = 0
36 @end example
37 >>>)
38 (It is also sometimes denoted by @math{C}).
40 The numeric value of @code{%catalan} is approximately
41 0.915965594177219.  (See @urldlmf{25.11.E40}).
42 @opencatbox{Categories:}
43 @category{Constants}
44 @closecatbox
45 @end defvr
47 @c -----------------------------------------------------------------------------
48 @anchor{%e}
49 @defvr {Constant} %e
50 @vrindex e
51 @vrindex Euler's number
52 @vrindex Base of natural logarithm
54 @code{%e} represents the base of the natural logarithm, also known as Euler's
55 number.  The numeric value of @code{%e} is the double-precision floating-point
56 value 2.718281828459045d0.  (See @urlaands{eqn 4.1.16, 67}, @urlaands{4.1.17, 67}.)
58 @opencatbox{Categories:}
59 @category{Constants}
60 @closecatbox
61 @end defvr
63 @c -----------------------------------------------------------------------------
64 @anchor{%i}
65 @vrindex i
66 @vrindex Imaginary unit
67 @defvr {Constant} %i
69 @code{%i} represents the imaginary unit, 
70 m4_mathdot(\sqrt{-1}, sqrt(- 1))
72 @opencatbox{Categories:}
73 @category{Constants}
74 @closecatbox
75 @end defvr
77 @c -----------------------------------------------------------------------------
78 @anchor{false}
79 @defvr {Constant} false
81 @code{false} represents the Boolean constant of the same name.
82 Maxima implements @code{false} by the value @code{NIL} in Lisp.
84 @opencatbox{Categories:}
85 @category{Constants}
86 @closecatbox
87 @end defvr
89 @c -----------------------------------------------------------------------------
90 @anchor{%gamma}
91 @vrindex Euler-Mascheroni constant
92 @defvr {Constant} %gamma
94 The Euler-Mascheroni constant, 0.5772156649015329.... It is defined by (@urlaands{eqn 6.1.3, 255} and @urldlmf{5.2.ii})
95 m4_displaymath(
96 <<<\gamma = \lim_{n \rightarrow \infty} \left(\sum_{k=1}^n {1\over k} - \log n\right)>>>,
97 <<<
98 @example
99                                    n
100                                   ====
101                                   \     1
102                %gamma = limit    ( >    - - log(n))
103                         n -> inf  /     k
104                                   ====
105                                   k = 1
106 @end example
107 >>>)
109 @c DOUBTLESS THERE IS MORE TO SAY HERE.
111 @opencatbox{Categories:}
112 @category{Constants}
113 @closecatbox
114 @end defvr
116 @c -----------------------------------------------------------------------------
117 @anchor{ind}
118 @vrindex Indeterminate
119 @defvr {Constant} ind
121 @code{ind} represents a bounded, indefinite result.
123 See also @mrefdot{limit}
125 Example:
127 @c ===beg===
128 @c limit (sin(1/x), x, 0);
129 @c ===end===
130 @example
131 (%i1) limit (sin(1/x), x, 0);
132 (%o1)                          ind
133 @end example
135 @opencatbox{Categories:}
136 @category{Constants}
137 @closecatbox
138 @end defvr
140 @c -----------------------------------------------------------------------------
141 @anchor{inf}
142 @vrindex Real infinity
143 @defvr {Constant} inf
145 @code{inf} represents real positive infinity.
147 @opencatbox{Categories:}
148 @category{Constants}
149 @closecatbox
150 @end defvr
152 @c -----------------------------------------------------------------------------
153 @anchor{infinity}
154 @vrindex Complex infinity
155 @defvr {Constant}  infinity
157 @code{infinity} represents complex infinity.
159 @opencatbox{Categories:}
160 @category{Constants}
161 @closecatbox
162 @end defvr
165 @c -----------------------------------------------------------------------------
166 @anchor{least_negative_float}
167 @defvr {Constant} least_negative_float
168 The least negative floating-point number in Maxima.  That is, the
169 negative floating-point number closest to 0.  It is approximately
170 -4.94065e-324, when
171 @url{https://en.wikipedia.org/wiki/Subnormal_number,denormal} numbers
172 are supported.  Otherwise it is the same as
173 @mref{least_negative_normalized_float}.
175 @opencatbox{Categories:}
176 @category{Constants}
177 @closecatbox
178 @end defvr
180 @c -----------------------------------------------------------------------------
181 @anchor{least_negative_normalized_float}
182 @defvr {Constant} least_negative_normalized_float
183 The least negative normalized floating-point number in Maxima.  That
184 is, the negative normalized floating-point number closest to 0.  It is
185 approximately -2.22507e-308.
187 @opencatbox{Categories:}
188 @category{Constants}
189 @closecatbox
190 @end defvr
192 @c -----------------------------------------------------------------------------
193 @anchor{least_positive_float}
194 @defvr {Constant} least_positive_float
195 The least positive floating-point number in Maxima.  That is, the
196 positive floating-point number closest to 0.  It is approximately
197 4.94065e-324, when
198 @url{https://en.wikipedia.org/wiki/Subnormal_number,denormal} numbers
199 are supported.  Otherwise it is the same as
200 @mref{least_positive_normalized_float}.
202 @opencatbox{Categories:}
203 @category{Constants}
204 @closecatbox
205 @end defvr
207 @anchor{least_positive_normalized_float}
208 @defvr {Constant} least_positive_normalized_float
209 The least positive normalized floating-point number in Maxima.  That
210 is, the positive normalized floating-point number closest to 0.  It is
211 approximately 2.22507e-308.
213 @opencatbox{Categories:}
214 @category{Constants}
215 @closecatbox
216 @end defvr
218 @c -----------------------------------------------------------------------------
219 @anchor{minf}
220 @vrindex Minus infinity
221 @vrindex Negative infinity
222 @defvr {Constant} minf
224 @code{minf} represents real minus (i.e., negative) infinity.
226 @opencatbox{Categories:}
227 @category{Constants}
228 @closecatbox
229 @end defvr
231 @c -----------------------------------------------------------------------------
232 @anchor{most_negative_float}
233 @defvr {Constant} most_negative_float
234 The most negative floating-point number in Maxima.  It is
235 approximately -1.79769e+308.
237 @opencatbox{Categories:}
238 @category{Constants}
239 @closecatbox
240 @end defvr
242 @c -----------------------------------------------------------------------------
243 @anchor{most_positive_float}
244 @defvr {Constant} most_positive_float
245 The most positive floating-point number in Maxima.  It is
246 approximately 1.797693e+308.
248 @opencatbox{Categories:}
249 @category{Constants}
250 @closecatbox
251 @end defvr
253 @c -----------------------------------------------------------------------------
254 @anchor{%phi}
255 @vrindex phi
256 @vrindex Golden mean
257 @defvr {Constant} %phi
259 @code{%phi} represents the so-called @i{golden mean}, 
260 m4_mathdot((1+\sqrt{5})/2, (1 + sqrt(5))/2)
261 The numeric value of @code{%phi} is the double-precision floating-point value
262 1.618033988749895d0.
264 @mref{fibtophi} expresses Fibonacci numbers @code{fib(n)} in terms of
265 @code{%phi}.
267 By default, Maxima does not know the algebraic properties of @code{%phi}.
268 After evaluating @code{tellrat(%phi^2 - %phi - 1)} and @code{algebraic: true},
269 @mref{ratsimp} can simplify some expressions containing @code{%phi}.
271 Examples:
273 @code{fibtophi} expresses Fibonacci numbers @code{fib(n)} in terms of @code{%phi}.
275 @c ===beg===
276 @c fibtophi (fib (n));
277 @c fib (n-1) + fib (n) - fib (n+1);
278 @c fibtophi (%);
279 @c ratsimp (%);
280 @c ===end===
281 @example
282 (%i1) fibtophi (fib (n));
283                            n             n
284                        %phi  - (1 - %phi)
285 (%o1)                  -------------------
286                            2 %phi - 1
287 (%i2) fib (n-1) + fib (n) - fib (n+1);
288 (%o2)          - fib(n + 1) + fib(n) + fib(n - 1)
289 (%i3) fibtophi (%);
290             n + 1             n + 1       n             n
291         %phi      - (1 - %phi)        %phi  - (1 - %phi)
292 (%o3) - --------------------------- + -------------------
293                 2 %phi - 1                2 %phi - 1
294                                           n - 1             n - 1
295                                       %phi      - (1 - %phi)
296                                     + ---------------------------
297                                               2 %phi - 1
298 (%i4) ratsimp (%);
299 (%o4)                           0
300 @end example
302 By default, Maxima does not know the algebraic properties of @code{%phi}.
303 After evaluating @code{tellrat (%phi^2 - %phi - 1)} and @code{algebraic: true},
304 @code{ratsimp} can simplify some expressions containing @code{%phi}.
306 @c ===beg===
307 @c e : expand ((%phi^2 - %phi - 1) * (A + 1));
308 @c ratsimp (e);
309 @c tellrat (%phi^2 - %phi - 1);
310 @c algebraic : true;
311 @c ratsimp (e);
312 @c ===end===
313 @example
314 (%i1) e : expand ((%phi^2 - %phi - 1) * (A + 1));
315                  2                      2
316 (%o1)        %phi  A - %phi A - A + %phi  - %phi - 1
317 (%i2) ratsimp (e);
318                   2                     2
319 (%o2)        (%phi  - %phi - 1) A + %phi  - %phi - 1
320 (%i3) tellrat (%phi^2 - %phi - 1);
321                             2
322 (%o3)                  [%phi  - %phi - 1]
323 (%i4) algebraic : true;
324 (%o4)                         true
325 (%i5) ratsimp (e);
326 (%o5)                           0
327 @end example
329 @opencatbox{Categories:}
330 @category{Constants}
331 @closecatbox
332 @end defvr
334 @c -----------------------------------------------------------------------------
335 @anchor{%pi}
336 @vrindex pi
337 @defvr {Constant} %pi
339 @code{%pi} represents the ratio of the perimeter of a circle to its diameter.
340 The numeric value of @code{%pi} is the double-precision floating-point value
341 3.141592653589793d0.
343 @opencatbox{Categories:}
344 @category{Constants}
345 @closecatbox
346 @end defvr
348 @c -----------------------------------------------------------------------------
349 @anchor{true}
350 @defvr {Constant} true
352 @code{true} represents the Boolean constant of the same name.
353 Maxima implements @code{true} by the value @code{T} in Lisp.
355 @opencatbox{Categories:}
356 @category{Constants}
357 @closecatbox
358 @end defvr
360 @c -----------------------------------------------------------------------------
361 @anchor{und}
362 @vrindex Undefined
363 @defvr {Constant} und
365 @code{und} represents an undefined result.
367 See also @mrefdot{limit}
369 Example:
371 @c ===beg===
372 @c limit (x*sin(x), x, inf);
373 @c ===end===
374 @example
375 (%i1) limit (x*sin(x), x, inf);
376 (%o1)                          und
377 @end example
379 @opencatbox{Categories:}
380 @category{Constants}
381 @closecatbox
382 @end defvr
384 @c -----------------------------------------------------------------------------
385 @anchor{zeroa}
386 @defvr {Constant} zeroa
388 @code{zeroa} represents an infinitesimal above zero.  @code{zeroa} can be used
389 in expressions.  @code{limit} simplifies expressions which contain
390 infinitesimals.
392 See also @mref{zerob} and @mrefdot{limit}
394 Example:
396 @code{limit} simplifies expressions which contain infinitesimals:
398 @c ===beg===
399 @c limit(zeroa);
400 @c limit(zeroa+x);
401 @c ===end===
402 @example
403 (%i1) limit(zeroa);
404 (%o1)                           0
405 (%i2) limit(x+zeroa);
406 (%o2)                           x
407 @end example
409 @opencatbox{Categories:}
410 @category{Constants}
411 @closecatbox
412 @end defvr
414 @c -----------------------------------------------------------------------------
415 @anchor{zerob}
416 @defvr {Constant} zerob
418 @code{zerob} represents an infinitesimal below zero.  @code{zerob} can be used
419 in expressions.  @code{limit} simplifies expressions which contain
420 infinitesimals.
422 See also @mref{zeroa} and @mrefdot{limit}
424 @opencatbox{Categories:}
425 @category{Constants}
426 @closecatbox
427 @end defvr