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 -----------------------------------------------------------------------------
22 @vrindex Euler's number
23 @vrindex Base of natural logarithm
26 @code{%e} represents the base of the natural logarithm, also known as Euler's
27 number. The numeric value of @code{%e} is the double-precision floating-point
28 value 2.718281828459045d0. (See @urlaands{eqn 4.1.16, 67}, @urlaands{4.1.17, 67}.)
30 @opencatbox{Categories:}
35 @c -----------------------------------------------------------------------------
40 @vrindex Imaginary unit
43 @code{%i} represents the imaginary unit, m4_math(\sqrt{-1}, sqrt(- 1)).
45 @opencatbox{Categories:}
50 @c -----------------------------------------------------------------------------
52 @defvr {Constant} false
54 @code{false} represents the Boolean constant of the same name.
55 Maxima implements @code{false} by the value @code{NIL} in Lisp.
57 @opencatbox{Categories:}
62 @c -----------------------------------------------------------------------------
64 @defvr {Constant} %gamma
66 @vrindex Euler-Mascheroni constant
69 The Euler-Mascheroni constant, 0.5772156649015329.... It is defined by (@urlaands{eqn 6.1.3, 255} and @urldlmf{5.2.ii})
71 <<<\gamma = \lim_{n \rightarrow \infty} \left(\sum_{k=1}^n {1\over k} - \log n\right)>>>,
77 %gamma = limit ( > - - log(n))
84 @c DOUBTLESS THERE IS MORE TO SAY HERE.
86 @opencatbox{Categories:}
91 @c -----------------------------------------------------------------------------
95 @vrindex Indeterminate
98 @code{ind} represents a bounded, indefinite result.
100 See also @mrefdot{limit}
105 @c limit (sin(1/x), x, 0);
108 (%i1) limit (sin(1/x), x, 0);
112 @opencatbox{Categories:}
117 @c -----------------------------------------------------------------------------
119 @defvr {Constant} inf
121 @vrindex Real infinity
124 @code{inf} represents real positive infinity.
126 @opencatbox{Categories:}
131 @c -----------------------------------------------------------------------------
133 @defvr {Constant} infinity
135 @vrindex Complex infinity
138 @code{infinity} represents complex infinity.
140 @opencatbox{Categories:}
145 @c -----------------------------------------------------------------------------
147 @defvr {Constant} minf
149 @vrindex Minus infinity
150 @vrindex Negative infinity
153 @code{minf} represents real minus (i.e., negative) infinity.
155 @opencatbox{Categories:}
160 @c -----------------------------------------------------------------------------
162 @defvr {Constant} %phi
168 @code{%phi} represents the so-called @i{golden mean}, m4_math((1+\sqrt{5})/2, (1 + sqrt(5))/2).
169 The numeric value of @code{%phi} is the double-precision floating-point value
172 @mref{fibtophi} expresses Fibonacci numbers @code{fib(n)} in terms of
175 By default, Maxima does not know the algebraic properties of @code{%phi}.
176 After evaluating @code{tellrat(%phi^2 - %phi - 1)} and @code{algebraic: true},
177 @mref{ratsimp} can simplify some expressions containing @code{%phi}.
181 @code{fibtophi} expresses Fibonacci numbers @code{fib(n)} in terms of @code{%phi}.
184 @c fibtophi (fib (n));
185 @c fib (n-1) + fib (n) - fib (n+1);
190 (%i1) fibtophi (fib (n));
193 (%o1) -------------------
195 (%i2) fib (n-1) + fib (n) - fib (n+1);
196 (%o2) - fib(n + 1) + fib(n) + fib(n - 1)
199 %phi - (1 - %phi) %phi - (1 - %phi)
200 (%o3) - --------------------------- + -------------------
201 2 %phi - 1 2 %phi - 1
204 + ---------------------------
210 By default, Maxima does not know the algebraic properties of @code{%phi}.
211 After evaluating @code{tellrat (%phi^2 - %phi - 1)} and @code{algebraic: true},
212 @code{ratsimp} can simplify some expressions containing @code{%phi}.
215 @c e : expand ((%phi^2 - %phi - 1) * (A + 1));
217 @c tellrat (%phi^2 - %phi - 1);
222 (%i1) e : expand ((%phi^2 - %phi - 1) * (A + 1));
224 (%o1) %phi A - %phi A - A + %phi - %phi - 1
227 (%o2) (%phi - %phi - 1) A + %phi - %phi - 1
228 (%i3) tellrat (%phi^2 - %phi - 1);
230 (%o3) [%phi - %phi - 1]
231 (%i4) algebraic : true;
237 @opencatbox{Categories:}
242 @c -----------------------------------------------------------------------------
244 @defvr {Constant} %pi
249 @code{%pi} represents the ratio of the perimeter of a circle to its diameter.
250 The numeric value of @code{%pi} is the double-precision floating-point value
253 @opencatbox{Categories:}
258 @c -----------------------------------------------------------------------------
260 @defvr {Constant} true
262 @code{true} represents the Boolean constant of the same name.
263 Maxima implements @code{true} by the value @code{T} in Lisp.
265 @opencatbox{Categories:}
270 @c -----------------------------------------------------------------------------
272 @defvr {Constant} und
277 @code{und} represents an undefined result.
279 See also @mrefdot{limit}
284 @c limit (x*sin(x), x, inf);
287 (%i1) limit (x*sin(x), x, inf);
291 @opencatbox{Categories:}
296 @c -----------------------------------------------------------------------------
298 @defvr {Constant} zeroa
300 @code{zeroa} represents an infinitesimal above zero. @code{zeroa} can be used
301 in expressions. @code{limit} simplifies expressions which contain
304 See also @mref{zerob} and @mrefdot{limit}
308 @code{limit} simplifies expressions which contain infinitesimals:
317 (%i2) limit(x+zeroa);
321 @opencatbox{Categories:}
326 @c -----------------------------------------------------------------------------
328 @defvr {Constant} zerob
330 @code{zerob} represents an infinitesimal below zero. @code{zerob} can be used
331 in expressions. @code{limit} simplifies expressions which contain
334 See also @mref{zeroa} and @mrefdot{limit}
336 @opencatbox{Categories:}