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

minusp


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

Syntax

(minusp expr)
expr - the numeric expression to check
returns -  T  if the number is negative, NIL otherwise

Description

The 'minusp' predicate function checks to see if the number 'expr' is negative.  T  is returned if the number is negative [less than zero], NIL is returned otherwise. An error is generated if the 'expr' is not a numeric expression:

error: bad argument type

Examples

(minusp 1)             ; returns NIL
(minusp 0)             ; returns NIL
(minusp -1)            ; returns T
(minusp -.000000005)   ; returns T
(minusp #xFFFFFFFF)    ; returns T
(minusp #x01)          ; returns NIL

(minusp 'a)            ; error: bad argument type
(setq a -3.5)          ; set A to -3.5
(minusp a)             ; returns T

See the minusp predicate function in the XLISP 2.0 manual.

  Back to Top


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