41 lines
882 B
Plaintext
41 lines
882 B
Plaintext
;; Function To Be Tested: LOGTEST
|
|
;;
|
|
;; 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-LOGTEST.TEST
|
|
;;
|
|
;;
|
|
;; Syntax: (LOGTEST INTEGER1 INTEGER2)
|
|
;;
|
|
;; Function Description:
|
|
;; LOGTEST is a predicate that is true if any of
|
|
;; the bits designated by the 1's in INTEGER1 are 1's in INTEGER2.
|
|
;;
|
|
;; (LOGTEST X Y) = (NOT (ZEROP (LOGAND X Y)))
|
|
;;
|
|
;;
|
|
;; Argument(s): INTEGER1 - an integer
|
|
;; INTEGER2 - an integer
|
|
;;
|
|
;; Returns: a number
|
|
;;
|
|
|
|
|
|
|
|
(do-test logtest-test
|
|
(and (eq (logtest 1 0) nil)
|
|
(eq (logtest 0 1) nil)
|
|
(eq (logtest 1 1) t)
|
|
(eq (logtest 0 0) nil)
|
|
(eq (logtest 4 5) t)))
|
|
|
|
STOP
|