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.

logior

logior

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

SYNTAX

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

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


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