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

logior


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

Syntax

(logior expr1 ... )
exprN - an integer expression
returns - the result of the Inclusive OR operation

Description

The 'logior' function returns the logical bitwise 'inclusive-or' of the list of expressions. If there is only one argument, it is returned unaltered. If there are two or more arguments, the 'logior' function performs the 'inclusive-or' successively applying the bitwise operation.

Examples

(logior 0 0)               ; returns 0
(logior 0 1)               ; returns 1
(logior 1 0)               ; returns 1
(logior 1 1)               ; returns 1
        
(logior 1 2 4 8 16 32 64)  ; returns 127
(logior 5 #b010)           ; returns 7
(logior 99 #x1FF)          ; returns 511
(logior 99 #x400)          ; returns 1123

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 logior function in the XLISP 2.0 manual.

  Back to Top


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