Commit e8ca479f authored by pfdietz's avatar pfdietz

Added more informative output for a division test, and a comment explaining a...

Added more informative output for a division test, and a comment explaining a point about complex reciprocal.  Add ignore-errors wrappers for some compile-and-load forms.
parent 18f07f13
......@@ -96,15 +96,21 @@
collect (list i c r))
nil)
;;; This test will fail if you compute complex reciprocals
;;; naively. If z = a + bi, the naive approach computes
;;; z^-1 = c + di as c = a/(a^2+b^2), d = -b/(a^2+b^2).
;;; That loses precision, however. Instead, the implementation
;;; should do c = 1/(a+b/a), d = -1/(a/b+b).
(deftest /.7
(loop for bound in (list 1.0s5 1.0f10 1.0d20 1.0l20)
nconc
(loop for i = (1+ (random bound))
for c = (complex 0 i)
for r = (/ c)
repeat 10000
unless (eql r (complex 0 (- (/ i))))
collect (list i c r)))
repeat 1000
unless (= r (complex 0 (- (/ i))))
collect (list i c r (complex 0 (- (/ i))))))
nil)
(deftest /.8
......
......@@ -10,7 +10,3 @@
(progn (apply #'/ args) (values))
(division-by-zero () (values))
(condition (c) c)))
......@@ -6,7 +6,7 @@
(in-package :cl-test)
(compile-and-load "numbers-aux.lsp")
(compile-and-load "fceiling-aux.lsp")
(ignore-errors (compile-and-load "fceiling-aux.lsp"))
(deftest fceiling.error.1
(classify-error (fceiling))
......
......@@ -6,7 +6,7 @@
(in-package :cl-test)
(compile-and-load "numbers-aux.lsp")
(compile-and-load "ffloor-aux.lsp")
(ignore-errors (compile-and-load "ffloor-aux.lsp"))
(deftest ffloor.error.1
(classify-error (ffloor))
......
......@@ -6,7 +6,7 @@
(in-package :cl-test)
(compile-and-load "numbers-aux.lsp")
(compile-and-load "fround-aux.lsp")
(ignore-errors (compile-and-load "fround-aux.lsp"))
(deftest fround.error.1
(classify-error (fround))
......
......@@ -6,7 +6,7 @@
(in-package :cl-test)
(compile-and-load "numbers-aux.lsp")
(compile-and-load "ftruncate-aux.lsp")
(ignore-errors (compile-and-load "ftruncate-aux.lsp"))
(deftest ftruncate.error.1
(classify-error (ftruncate))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment