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.

logand

logand

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

SYNTAX

(logand <expr1> ... )
        <exprN>         -       an integer expression

DESCRIPTION

The LOGAND function returns the logical (bitwise) AND of the list of expressions. If there is only one argument, it is returned unaltered. If there are two or more arguments, the LOGAND function performs the logical and operation successively applying the bitwise operation.

EXAMPLES

(logand 0 0)                            ; returns 0
(logand 0 1)                            ; returns 0
(logand 1 0)                            ; returns 0
(logand 1 1)                            ; returns 1
(logand 55 #x0F)                        ; returns 7
(logand 7 #b0011)                       ; returns 3
(logand 1 2 4 8 16)                     ; returns 0
(logand 15 7 3)                         ; returns 3

NOTE: XLISP does not check when read-macro expansions (like #x0FF) are out of bounds. It gives no error message and will just truncate the number to the low-order bits that it can deal with (usually 32 bits or 8 hex digits).


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