XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

numberp


Type:   -   predicate function (subr)
Source:   -   xlbfun.c

Syntax

(numberp expr)
expr - the expression to check
returns -  T  if the expression is a number, NIL otherwise

Description

The 'numberp' predicate function checks if an 'expr' is a number.  T  is returned if 'expr' is an integer or floating point number, NIL is returned otherwise.

Examples

(numberp 1)         ; returns T - integer
(numberp 1.2)       ; returns T - float
(numberp '1)        ; returns T - still an integer
(numberp #x034)     ; returns T - the readmacro produces an integer

(numberp 'a)        ; returns NIL - symbol
(numberp #\a)       ; returns NIL - character
(numberp NIL)       ; returns NIL - NIL
(numberp #(0 1 2))  ; returns NIL - array

See the numberp predicate function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next