1
0
mirror of synced 2026-05-04 15:16:50 +00:00
Files
Interlisp.medley/internal/test/LANGUAGE/AUTO/12-4-INCF.TEST

50 lines
1.1 KiB
Plaintext

;; Function To Be Tested: INCF
;;
;; Source: Guy L Steele's CLTL
;; Section: 12.4 Arithmetic Operations
;; Page: 201
;;
;; Created By: Kelly Roach
;;
;; Creation Date: July 12,1986
;;
;; Last Update: Dec 22,1986, John Park
;;
;; Filed As: {ERIS}<LISPCORE>CML>TEST>12-4-INCF.TEST
;;
;;
;; Syntax: (INCF PLACE &OPTIONAL DELTA)
;;
;; Function Description:
;; This returns the complex conjugate of NUMBER. The conjugate
;; of a non-complex number is itself. For a complex number Z,
;;
;; (CONJUGATE Z) = (COMPLEX (REALPART Z) (- (IMAGPART Z)))
;;
;; For example:
;;
;; (CONJUGATE #C(3/5 4/5)) => #C(3/5 -4/5)
;; (CONJUGATE #C(0.0D0 -1.0D0)) => #C(0.0D0 1.0D0)
;; (CONJUGATE 3.7) => 3.7
;;
;;
;; Argument(s): PLACE - a generalized variable
;; DELTA - a number
;;
;; Returns: a number
;;
(do-test incf-test
(and (setq n 0)
(equalp (incf n) 1)
(equalp (incf n) 2)
(equalp (incf n 5) 7)
(zerop (decf n 7))
(equalp (incf n -1) -1)
)
)
STOP