Variables
Date: 2020-10-07 18:10:00

Up | Next | Prev | PrevTail | Tail

### 2.4 Variables

Every variable is named by an identiﬁer, and is given a speciﬁc 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, deﬁned as

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 ﬂoating point precision.

EULER_GAMMA

  Euler’s constant, also available as −ψ(1).

GOLDEN_RATIO

  The number .

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 ∞

  in limit and power series calculations for example, as well as in deﬁnite integration. Note however that the current system does not do proper arithmetic on ∞. For example, infinity + infinity is 2*infinity.

KHINCHIN

  Khinchin’s constant, deﬁned as

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 π to the current degree of ﬂoating point precision.

POSITIVE

  Used in the Roots package.

T

  Must not be used as a formal parameter or local variable in procedures, since conﬂict 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 Identiﬁers”. 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.

Up | Next | Prev | PrevTail | Front