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.

logxor

logxor

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

SYNTAX

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

DESCRIPTION

The LOGXOR function returns the logical (bitwise) EXCLUSIVE-OR of the list of expressions. If there is only one argument, it is returned unaltered. If there are two or more arguments, the LOGXOR function performs the exclusive-or successively applying the bitwise operation.

EXAMPLES

(logxor 0 0)                            ; returns 0
(logxor 0 1)                            ; returns 1
(logxor 1 0)                            ; returns 1
(logxor 1 1)                            ; returns 0
(logxor #b0011 #b0101)                  ; returns 6 
(logxor 255 #xF0)                       ; returns 15
(logxor 255 #x0F)                       ; returns 240
(logxor 255 (logxor 255 99))            ; returns 99

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.