Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

evenp

evenp

type: predicate function (subr)
location: built-in
source file: xlmath.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(evenp <expr> )
        <expr>          -       the integer numeric expression to check

DESCRIPTION

The EVENP predicate checks to see if the number <expr> is even. T is returned if the number is even, NIL is returned otherwise. A bad argument type error is generated if the <expr> is not a numeric expression. A bad floating point operation is generated if the <expr> is a floating point number. Zero is an even number.

EXAMPLES

(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 flt. pt. op.
(evenp 'a)                              ; error: bad argument type
(setq a 2)                              ; set value of A to 2
(evenp a)                               ; returns T


Go to the first, previous, next, last section, table of contents.