The 'evenp' predicate function checks to see if the number 'expr' is even. T is returned if the number is even, NIL is returned otherwise.
An error is generated if the 'expr' is not a numeric expression:
error: bad argument type
An error is generated if the 'expr' is a floating point number:
error: bad floating point operation
Zero is an even number.
(evenp 0) ; returns T (evenp 1) ; returns NIL (evenp 2) ; returns T (evenp -1) ; returns NIL (evenp -2) ; returns T (evenp 14.0) ; error: bad floating point operation (evenp 'a) ; error: bad argument type (setq a 2) ; set value of A to 2 (evenp a) ; returns T
See the
evenp
predicate function in the