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.

oddp

oddp

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

SYNTAX

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

DESCRIPTION

The ODDP predicate checks to see if the number <expr> is odd. T is returned if the number is odd, 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

(oddp 0)                                ; returns NIL
(oddp 1)                                ; returns T
(oddp 2)                                ; returns NIL
(oddp -1)                               ; returns T
(oddp -2)                               ; returns NIL
                                        ;
(oddp 13.0)                             ; error: bad flt. pt. op.
(oddp 'a)                               ; error: bad argument type
(setq a 3)                              ; set value of A to 3
(oddp a)                                ; returns T


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