XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

logxor


Type:   -   function (subr)
Source:   -   xlmath.c

Syntax

(logxor expr1 ... )
exprN - an integer expression
returns - the result of the eXclusive OR operation

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].

See the logxor function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next