next up previous
Contents Next: or (MACRO) Up: Appendix: Selected Lisp Previous: null (PREDICATE)

numberp (PREDICATE)

Format: (numberp <exp> )

Required arguments: 1

<exp> : any Lisp expression

The predicate numberp returns T if <exp> evaluates to a number (i.e. an object of type integer, ratio, float, or complex); numberp returns NIL otherwise.

Examples:

> (numberp 1/2)
T

> (numberp 1235439)
T

> (numberp (/ 5 1.23))
T

> (numberp #C(1.2 -0.9))
T

> (numberp '(+ 1 2 3))
NIL



© Colin Allen & Maneesh Dhagat
March 2007