48 lines
1.3 KiB
Plaintext
48 lines
1.3 KiB
Plaintext
;; Function To Be Tested: LOGNOR
|
|
;;
|
|
;; Source: Guy L Steele's CLTL
|
|
;; Section: 12.7 Logical Operations on Numbers
|
|
;; Page: 221
|
|
;;
|
|
;; Created By: Kelly Roach
|
|
;;
|
|
;; Creation Date: July 12,1986
|
|
;;
|
|
;; Last Update: July 12,1986
|
|
;;
|
|
;; Filed As: {ERIS}<LISPCORE>CML>TEST>12-7-LOGNOR.TEST
|
|
;;
|
|
;;
|
|
;; Syntax: (LOGNOR INTEGER1 INTEGER2)
|
|
;;
|
|
;; Function Description:
|
|
;; These are the other six non-trivial bit-wise logical operations
|
|
;; on two arguments. Because they are not associative,
|
|
;; they take exactly two arguments rather than any non-negative number
|
|
;; of arguments.
|
|
;;
|
|
;;
|
|
;; (LOGNAND N1 N2) = (LOGNOT (LOGAND N1 N2))
|
|
;; (LOGNOR N1 N2) = (LOGNOT (LOGIOR N1 N2))
|
|
;; (LOGANDC1 N1 N2) = (LOGAND (LOGNOT N1) N2)
|
|
;; (LOGANDC2 N1 N2) = (LOGAND N1 (LOGNOT N2))
|
|
;; (LOGIORC1 N1 N2) = (LOGIOR (LOGNOT N1) N2)
|
|
;; (LOGIORC2 N1 N2) = (LOGIOR N1 (LOGNOT N2))
|
|
;;
|
|
;;
|
|
;; Argument(s): INTEGER1 - an integer
|
|
;; INTEGER2 - an integer
|
|
;;
|
|
;; Returns: a number
|
|
;;
|
|
|
|
|
|
|
|
(do-test lognor-test
|
|
(and (eq (logand 1 (lognor 0 0)) 1)
|
|
(eq (logand 1 (lognor 0 1)) 0)
|
|
(eq (logand 1 (lognor 1 0)) 0)
|
|
(eq (logand 1 (lognor 1 1)) 0)))
|
|
|
|
STOP
|