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


63.3.5 The category ‘nonnegative

The category of nonnegatives are those comparables which are not less than zero. This explicitly implies, that 0 is nonnegative. The restriction to comparables is necessary, since the membership is indeed tested as in the definition.

The category’s predicate is nonnegativep.

Function: nonnegativep object

Return t if object is a nonnegative number, nil otherwise.

We call a number object non-negative iff it is comparable and its value is not less than 0.

(nonnegativep 0)
     ⇒ t
(nonnegativep 1/2)
     ⇒ t
(nonnegativep 1.5)
     ⇒ t
(nonnegativep -1/2)
     ⇒ nil
(nonnegativep -0.5)
     ⇒ nil
(nonnegativep 1+2i)
     ⇒ nil