48 lines
1.0 KiB
Plaintext
48 lines
1.0 KiB
Plaintext
;; Function To Be Tested: DECF
|
|
;;
|
|
;; Source: Guy L Steele's CLTL
|
|
;; Section: 12.4 Arithmetic Operations
|
|
;; Page: 201
|
|
;;
|
|
;; Created By: Kelly Roach
|
|
;;
|
|
;; Creation Date: July 12,1986
|
|
;;
|
|
;; Last Update: July 12,1986
|
|
;;
|
|
;; Filed As: {ERIS}<LISPCORE>CML>TEST>12-4-DECF.TEST
|
|
;;
|
|
;;
|
|
;; Syntax: (DECF 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 decf-test
|
|
(and (setq n 0)
|
|
(equalp (decf n) -1)
|
|
(equalp (decf n) -2)
|
|
(equalp (decf n 5) -7)
|
|
(zerop (incf n 7))
|
|
(equalp (decf n 1) -1)))
|
|
|
|
STOP
|