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


63.3.11 The category ‘zero

The category of zeroes are all numbers which represent a zero, that is an additive neutral element. In that sense, the following is always true:

(equal num (+ 0 num))

The category’s predicate is zerop.

Function: zerop object

Return t if object is a zero, nil otherwise.

Let us look at a variety of examples.

(zerop 0)
     ⇒ t
(zerop 0/1)
     ⇒ t
(zerop 0.0)
     ⇒ t
(zerop 0+0i)
     ⇒ t
(zerop 0.0+0.0i)
     ⇒ t
(zerop 0+7Z)
     ⇒ t
(zerop 7+7Z)
     ⇒ t
(zerop 0+0i+0j+0k)
     ⇒ t

There is a constructor for zeroes which accepts an arbitrary number and uses that to determine the world, read type, the number lives in. Afterwards it creates and returns the zero of that number type.

Function: zero number

Return the zero of the world number lives in.

(zero 23)
     ⇒ 0
(zero 2/3)
     ⇒ 0
(zero 1.4)
     ⇒ 0.0
(zero 1+2i)
     ⇒ 0+0i
(zero 1.2+3.4i)
     ⇒ 0.000000+0.000000i
(zero 7+14Z)
     ⇒ 0+14Z
(zero 7+13Z)
     ⇒ 0+13Z