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.

lognot

lognot

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

SYNTAX

(lognot  <expr> )
        <expr>          -       an integer expression

DESCRIPTION

The LOGNOT function returns the logical (bitwise) INVERSION of the expression.

EXAMPLES

(lognot 255)                            ; returns -256
(lognot #xffff0000)                     ; returns 65535
(lognot #x00000000)                     ; returns -1
(lognot 1)                              ; returns -2
                                        ;
(logand (lognot 256) 65535)             ; returns 65279
(lognot #xFFFFFFFE)                     ; returns 1
(lognot #xFFFFFFFC)                     ; 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.