Next: , Previous: , Up: Types of Numbers   [Contents][Index]


63.2.7 The Type ‘indefinite

In order to handle indefinite number values, SXEmacs provides an abstract type to gather these and sophisticated means to handle them. Indefinites are treated like ordinary numbers. They take part in arithmetic and can be used for many mathematical functions.

Howbeit, indefinites cannot be explicitly generated because there merely finitely many. Hence there are variables which refer to the indefinites, their print syntax is identical to their symbol name.

Variable: +infinity

A symbol representing positive infinity.

Variable: -infinity

A symbol representing negative infinity.

Variable: complex-infinity

A symbol representing the infinitely distant point in the complex plane.

Variable: not-a-number

A symbol representing a not-a-number (NaN) value.

The big difference to other number objects is that indefinites may shadow another other number types. This makes them more a category than actually a number type of its own. Due to efficiency reasons and cleaner coding we have chosen to assign them their own type and allowed them to behave as another number type. That is SXEmacs does not distinguish between the positively infinite point of the rational integers and the positively infinite point of the reals.

On the other hand (and as typically seen in mathematics), the infinities are not part of the class of numbers of a certain type, therefore the type predicates of other number types will always yield nil. That means the programmer must track the history of computations to find out which element or term spawned the occurrence of indefinites (if that information is valuable of course).

As usual for number types indefinites have their own predicate

Function: indefinitep object

Return t if object is an indefinite symbol, nil otherwise.

Infinities, a subset of the indefinites, can be type-checked separatedly.

Function: infinityp object

Return t if object is a form of infinity, nil otherwise.

Note also, the indefinite not-a-number is indeed not a number, thence the category predicate numberp will return nil for not-a-number (see Category number).


Next: , Previous: , Up: Types of Numbers   [Contents][Index]