1 @c -----------------------------------------------------------------------------
3 @node Constants, Lists, Strings, Data Types and Structures
5 @c -----------------------------------------------------------------------------
8 * Functions and Variables for Constants::
11 @c -----------------------------------------------------------------------------
12 @node Functions and Variables for Constants, , Constants, Constants
13 @subsection Functions and Variables for Constants
14 @c -----------------------------------------------------------------------------
16 @c -----------------------------------------------------------------------------
21 @vrindex Euler's number
22 @vrindex Base of natural logarithm
25 @code{%e} represents the base of the natural logarithm, also known as Euler's
26 number. The numeric value of @code{%e} is the double-precision floating-point
27 value 2.718281828459045d0.
29 @opencatbox{Categories:}
34 @c -----------------------------------------------------------------------------
39 @vrindex Imaginary unit
42 @code{%i} represents the imaginary unit, @math{sqrt(- 1)}.
44 @opencatbox{Categories:}
49 @c -----------------------------------------------------------------------------
51 @defvr {Constant} false
53 @code{false} represents the Boolean constant of the same name.
54 Maxima implements @code{false} by the value @code{NIL} in Lisp.
56 @opencatbox{Categories:}
61 @c -----------------------------------------------------------------------------
63 @defvr {Constant} %gamma
65 @vrindex Euler-Mascheroni constant
68 The Euler-Mascheroni constant, 0.5772156649015329 ....
69 @c DOUBTLESS THERE IS MORE TO SAY HERE.
71 @opencatbox{Categories:}
76 @c -----------------------------------------------------------------------------
80 @vrindex Indeterminate
83 @code{ind} represents a bounded, indefinite result.
85 See also @mrefdot{limit}
90 @c limit (sin(1/x), x, 0);
93 (%i1) limit (sin(1/x), x, 0);
97 @opencatbox{Categories:}
102 @c -----------------------------------------------------------------------------
104 @defvr {Constant} inf
106 @vrindex Real infinity
109 @code{inf} represents real positive infinity.
111 @opencatbox{Categories:}
116 @c -----------------------------------------------------------------------------
118 @defvr {Constant} infinity
120 @vrindex Complex infinity
123 @code{infinity} represents complex infinity.
125 @opencatbox{Categories:}
130 @c -----------------------------------------------------------------------------
132 @defvr {Constant} minf
134 @vrindex Minus infinity
135 @vrindex Negative infinity
138 @code{minf} represents real minus (i.e., negative) infinity.
140 @opencatbox{Categories:}
145 @c -----------------------------------------------------------------------------
147 @defvr {Constant} %phi
153 @code{%phi} represents the so-called @i{golden mean}, @math{(1 + sqrt(5))/2}.
154 The numeric value of @code{%phi} is the double-precision floating-point value
157 @mref{fibtophi} expresses Fibonacci numbers @code{fib(n)} in terms of
160 By default, Maxima does not know the algebraic properties of @code{%phi}.
161 After evaluating @code{tellrat(%phi^2 - %phi - 1)} and @code{algebraic: true},
162 @mref{ratsimp} can simplify some expressions containing @code{%phi}.
166 @code{fibtophi} expresses Fibonacci numbers @code{fib(n)} in terms of @code{%phi}.
169 @c fibtophi (fib (n));
170 @c fib (n-1) + fib (n) - fib (n+1);
175 (%i1) fibtophi (fib (n));
178 (%o1) -------------------
180 (%i2) fib (n-1) + fib (n) - fib (n+1);
181 (%o2) - fib(n + 1) + fib(n) + fib(n - 1)
184 %phi - (1 - %phi) %phi - (1 - %phi)
185 (%o3) - --------------------------- + -------------------
186 2 %phi - 1 2 %phi - 1
189 + ---------------------------
195 By default, Maxima does not know the algebraic properties of @code{%phi}.
196 After evaluating @code{tellrat (%phi^2 - %phi - 1)} and @code{algebraic: true},
197 @code{ratsimp} can simplify some expressions containing @code{%phi}.
200 @c e : expand ((%phi^2 - %phi - 1) * (A + 1));
202 @c tellrat (%phi^2 - %phi - 1);
207 (%i1) e : expand ((%phi^2 - %phi - 1) * (A + 1));
209 (%o1) %phi A - %phi A - A + %phi - %phi - 1
212 (%o2) (%phi - %phi - 1) A + %phi - %phi - 1
213 (%i3) tellrat (%phi^2 - %phi - 1);
215 (%o3) [%phi - %phi - 1]
216 (%i4) algebraic : true;
222 @opencatbox{Categories:}
227 @c -----------------------------------------------------------------------------
229 @defvr {Constant} %pi
234 @code{%pi} represents the ratio of the perimeter of a circle to its diameter.
235 The numeric value of @code{%pi} is the double-precision floating-point value
238 @opencatbox{Categories:}
243 @c -----------------------------------------------------------------------------
245 @defvr {Constant} true
247 @code{true} represents the Boolean constant of the same name.
248 Maxima implements @code{true} by the value @code{T} in Lisp.
250 @opencatbox{Categories:}
255 @c -----------------------------------------------------------------------------
257 @defvr {Constant} und
262 @code{und} represents an undefined result.
264 See also @mrefdot{limit}
269 @c limit (x*sin(x), x, inf);
272 (%i1) limit (x*sin(x), x, inf);
276 @opencatbox{Categories:}
281 @c -----------------------------------------------------------------------------
283 @defvr {Constant} zeroa
285 @code{zeroa} represents an infinitesimal above zero. @code{zeroa} can be used
286 in expressions. @code{limit} simplifies expressions which contain
289 See also @mref{zerob} and @mrefdot{limit}
293 @code{limit} simplifies expressions which contain infinitesimals:
302 (%i2) limit(x+zeroa);
306 @opencatbox{Categories:}
311 @c -----------------------------------------------------------------------------
313 @defvr {Constant} zerob
315 @code{zerob} represents an infinitesimal below zero. @code{zerob} can be used
316 in expressions. @code{limit} simplifies expressions which contain
319 See also @mref{zeroa} and @mrefdot{limit}
321 @opencatbox{Categories:}