40 lines
814 B
Plaintext
40 lines
814 B
Plaintext
;; Function To Be Tested: LOGNOT
|
|
;;
|
|
;; Source: Guy L Steele's CLTL
|
|
;; Section: 12.7 Logical Operations on Numbers
|
|
;; Page: 223
|
|
;;
|
|
;; Created By: Kelly Roach
|
|
;;
|
|
;; Creation Date: July 12,1986
|
|
;;
|
|
;; Last Update: July 12,1986
|
|
;;
|
|
;; Filed As: {ERIS}<LISPCORE>CML>TEST>12-7-LOGNOT.TEST
|
|
;;
|
|
;;
|
|
;; Syntax: (LOGNOT INTEGER)
|
|
;;
|
|
;; Function Description:
|
|
;; This returns the bit-wise logical NOT of its argument.
|
|
;; Every bit of the result is the complement of the corresponding bit
|
|
;; in the argument.
|
|
;;
|
|
;; (LOGBITP J (LOGNOT X)) = (NOT (LOGBITP J X))
|
|
;;
|
|
;;
|
|
;; Argument(s): INTEGER - an integer
|
|
;;
|
|
;; Returns: a number
|
|
;;
|
|
|
|
|
|
|
|
(do-test lognot-test
|
|
(and (eq (lognot 1) -2)
|
|
(eq (lognot 0) -1)
|
|
(eq (lognot -1) 0)
|
|
(eq (lognot 19) -20)))
|
|
|
|
STOP
|