REDUCE

2.4 Variables

Every variable is named by an identifier, and is given a specific type. The type is of no concern to the ordinary user. Most variables are allowed to have the default type, called scalar. These can receive, as values, the representation of any ordinary algebraic expression. In the absence of such a value, they stand for themselves.

Reserved Variables

Several variables in REDUCE have particular properties which should not be changed by the user. These variables include:

Catalan

Catalan’s constant, defined as \[ \sum _{n=0}^{\infty } \frac {(-1)^{n}}{(2n+1)^{2}} . \]

e

Intended to represent the base of the natural logarithms. log(e), if it occurs in an expression, is automatically replaced by 1. If rounded is on, e is replaced by the value of e to the current degree of floating point precision.

Euler_Gamma

Euler’s constant, also available as \(-\psi (1)\).

Golden_Ratio

The number \(\frac {1+\sqrt {5}}{2}\).

i

Intended to represent the square root of \(-1\). i^2 is replaced by \(-1\), and appropriately for higher powers of i. This applies only to the symbol i used on the top level, not as a formal parameter in a procedure, a local variable, nor in the context for i:= ....

infinity

Intended to represent \(\infty \)

in limit and power series calculations for example, as well as in definite integration. Note however that the current system does not do proper arithmetic on \(\infty \). For example, infinity + infinity is 2*infinity.

Khinchin

Khinchin’s constant, defined as \[ \prod _{n=1}^{\infty }\left (1+\frac {1}{n(n+2)}\right )^{\log _{2} n} . \]

negative

Used in the Roots package.

nil

In REDUCE (algebraic mode only) taken as a synonym for zero. Therefore nil cannot be used as a variable.

pi

Intended to represent the circular constant. With rounded on, it is replaced by the value of \(\pi \) to the current degree of floating point precision.

positive

Used in the Roots package.

t

Must not be used as a formal parameter or local variable in procedures, since conflict arises with the symbolic mode meaning of t as true.

Other reserved variables, such as low_pow, described in other sections, are listed in Appendix A.

Using these reserved variables inappropriately will lead to errors.

There are also internal variables used by REDUCE that have similar restrictions. These usually have an asterisk in their names, so it is unlikely a casual user would use one. An example of such a variable is k!* used in the asymptotic command package.

Certain words are reserved in REDUCE. They may only be used in the manner intended. A list of these is given in the section “Reserved Identifiers”. There are, of course, an impossibly large number of such names to keep in mind. The reader may therefore want to make himself a copy of the list, deleting the names he doesn’t think he is likely to use by mistake.


Hosted by Download REDUCE Powered by MathJax