1 @c -*- mode: texinfo -*-
2 @c -----------------------------------------------------------------------------
4 @node Constants, Lists, Strings, Data Types and Structures
6 @c -----------------------------------------------------------------------------
9 * Functions and Variables for Constants::
12 @c -----------------------------------------------------------------------------
13 @node Functions and Variables for Constants, , Constants, Constants
14 @subsection Functions and Variables for Constants
15 @c -----------------------------------------------------------------------------
17 @c -----------------------------------------------------------------------------
19 @defvr {Constant} %catalan
21 @vrindex Catalan's Constant
23 @code{%catalan} represents Catalan's constant, @math{G}, defined by
25 <<<G = \sum_{n=0}^\infty {(-1)^n\over (2n+1)^2}>>>,
31 %catalan = ⟩ ──────────
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:}
47 @c -----------------------------------------------------------------------------
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:}
63 @c -----------------------------------------------------------------------------
66 @vrindex Imaginary unit
69 @code{%i} represents the imaginary unit,
70 m4_mathdot(\sqrt{-1}, sqrt(- 1))
72 @opencatbox{Categories:}
77 @c -----------------------------------------------------------------------------
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:}
89 @c -----------------------------------------------------------------------------
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})
96 <<<\gamma = \lim_{n \rightarrow \infty} \left(\sum_{k=1}^n {1\over k} - \log n\right)>>>,
102 %gamma = limit ( > - - log(n))
109 @c DOUBTLESS THERE IS MORE TO SAY HERE.
111 @opencatbox{Categories:}
116 @c -----------------------------------------------------------------------------
118 @vrindex Indeterminate
119 @defvr {Constant} ind
121 @code{ind} represents a bounded, indefinite result.
123 See also @mrefdot{limit}
128 @c limit (sin(1/x), x, 0);
131 (%i1) limit (sin(1/x), x, 0);
135 @opencatbox{Categories:}
140 @c -----------------------------------------------------------------------------
142 @vrindex Real infinity
143 @defvr {Constant} inf
145 @code{inf} represents real positive infinity.
147 @opencatbox{Categories:}
152 @c -----------------------------------------------------------------------------
154 @vrindex Complex infinity
155 @defvr {Constant} infinity
157 @code{infinity} represents complex infinity.
159 @opencatbox{Categories:}
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
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:}
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:}
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
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:}
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:}
218 @c -----------------------------------------------------------------------------
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:}
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:}
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:}
253 @c -----------------------------------------------------------------------------
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
264 @mref{fibtophi} expresses Fibonacci numbers @code{fib(n)} in terms of
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}.
273 @code{fibtophi} expresses Fibonacci numbers @code{fib(n)} in terms of @code{%phi}.
276 @c fibtophi (fib (n));
277 @c fib (n-1) + fib (n) - fib (n+1);
282 (%i1) fibtophi (fib (n));
285 (%o1) -------------------
287 (%i2) fib (n-1) + fib (n) - fib (n+1);
288 (%o2) - fib(n + 1) + fib(n) + fib(n - 1)
291 %phi - (1 - %phi) %phi - (1 - %phi)
292 (%o3) - --------------------------- + -------------------
293 2 %phi - 1 2 %phi - 1
296 + ---------------------------
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}.
307 @c e : expand ((%phi^2 - %phi - 1) * (A + 1));
309 @c tellrat (%phi^2 - %phi - 1);
314 (%i1) e : expand ((%phi^2 - %phi - 1) * (A + 1));
316 (%o1) %phi A - %phi A - A + %phi - %phi - 1
319 (%o2) (%phi - %phi - 1) A + %phi - %phi - 1
320 (%i3) tellrat (%phi^2 - %phi - 1);
322 (%o3) [%phi - %phi - 1]
323 (%i4) algebraic : true;
329 @opencatbox{Categories:}
334 @c -----------------------------------------------------------------------------
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
343 @opencatbox{Categories:}
348 @c -----------------------------------------------------------------------------
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:}
360 @c -----------------------------------------------------------------------------
363 @defvr {Constant} und
365 @code{und} represents an undefined result.
367 See also @mrefdot{limit}
372 @c limit (x*sin(x), x, inf);
375 (%i1) limit (x*sin(x), x, inf);
379 @opencatbox{Categories:}
384 @c -----------------------------------------------------------------------------
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
392 See also @mref{zerob} and @mrefdot{limit}
396 @code{limit} simplifies expressions which contain infinitesimals:
405 (%i2) limit(x+zeroa);
409 @opencatbox{Categories:}
414 @c -----------------------------------------------------------------------------
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
422 See also @mref{zeroa} and @mrefdot{limit}
424 @opencatbox{Categories:}