1
0
mirror of synced 2026-02-12 11:17:23 +00:00
Files
Interlisp.medley/internal/test/LANGUAGE/AUTO/12-7-LOGAND.TEST

38 lines
813 B
Plaintext

;; Function To Be Tested: logand
;;
;; Source: Common Lisp by Guy Steele
;; Section 12.7: Logical Operations on Numbers Page: 221
;;
;; Created By: John Park
;;
;; Creation Date: July 11, 86
;;
;; Last Update:
;;
;; Filed as: {eris}<lispcore>cml>test>12-7-logand.test
;;
;; Syntax: logand &rest integers
;;
;; Function Description: This returns the bit-wise logical and or of its
;; arguments. If no argument is given, then the result is -1, which is
;; an identity for this operation.
;;
;; Argument(s): integer(s)
;;
;; Returns: -1 or integer
;;
;; Constraints/limitations: None
(do-test logand-test
(and (eq (logand 0 0) 0)
(eq (logand 0 1) 0)
(eq (logand 1 0) 0)
(eq (logand 1 1) 1)
(eq (logand) -1)
(eq (logand 11 5) 1)
(eq (logand 7 5 6) 4)))
STOP