Next: , Previous: , Up: Unions of Number Types   [Contents][Index]


63.3.4 The category ‘comparable

Deductively, the category of comparables are all numbers which possess a total (archimedean) order. Inductively, this category is the union of reals and rationals. Comparables, as the names suggests, can be directly compared with ordering relations, such as < or >.

The category’s predicate is comparablep.

Function: comparablep object

Return t if object is comparable (i.e. a real or a rational), nil otherwise.

We call a number comparable if there exists a total (archimedean) order on the underlying structure.

(comparablep 0)
     ⇒ t
(comparablep 1/2)
     ⇒ t
(comparablep 0.5)
     ⇒ t