40 lines
918 B
Plaintext
40 lines
918 B
Plaintext
;; Function To Be Tested: LOGEQV
|
|
;;
|
|
;; 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-LOGEQV.TEST
|
|
;;
|
|
;;
|
|
;; Syntax: (LOGEQV &REST INTEGERS)
|
|
;;
|
|
;; Function Description:
|
|
;; This returns the bit-wise logical EQUIVALENCE (also known as EXCLUSIVE NOR)
|
|
;; of its arguments.
|
|
;; If no argument is given, then the result is -1,
|
|
;; which is an identity for this operation.
|
|
;;
|
|
;; Argument(s): INTEGERS - an integer
|
|
;;
|
|
;; Returns: a number
|
|
;;
|
|
|
|
|
|
|
|
(do-test logeqv-test
|
|
(and (eq (logand 1 (logeqv 0 0)) 1)
|
|
(eq (logand 1 (logeqv 0 1)) 0)
|
|
(eq (logand 1 (logeqv 1 0)) 0)
|
|
(eq (logand 1 (logeqv 1 1)) 1)
|
|
(eq (logeqv) -1)
|
|
(eq (logeqv 7 5 6) 4)))
|
|
|
|
STOP
|