Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Karsten Poeck
ansi-test
Commits
cb199ecf
Commit
cb199ecf
authored
Aug 31, 2003
by
pfdietz
Browse files
More tests of *, including one that stimulates a compiler bug in sbcl/cmucl.
parent
7caea982
Changes
1
Hide whitespace changes
Inline
Side-by-side
ansi-tests/times.lsp
View file @
cb199ecf
...
...
@@ -296,6 +296,72 @@
collect (list x y p)))
nil)
(deftest *.24
(loop
for type in '(short-float single-float double-float long-float)
for bits in '(13 24 50 50)
for bound = (ash 1 (floor bits 2))
nconc
(loop for i = (random bound)
for x = (coerce i type)
for j = (random bound)
for y = (coerce j type)
for prod = (* x y)
repeat 10000
unless (and (eql prod (coerce (* i j) type))
(eql prod (* y x)))
collect (list i j x y (* x y) (coerce (* i j) type))))
nil)
(deftest *.25
(loop
for type in '(short-float single-float double-float long-float)
for bits in '(13 24 50 50)
for bound = (ash 1 (- bits 2))
when (= (float-radix (coerce 1.0 type)) 2)
nconc
(loop for i = (random bound)
for x = (coerce i type)
for j = (* i 2)
for y = (coerce j type)
repeat 1000
unless (eql (* 2 x) y)
collect (list i j x (* 2 x) y)))
nil)
;;; Shows a compiler bug in sbcl/cmucl
(deftest *.26
(eqlt (funcall (compile nil
'(lambda (x y)
(declare (type (single-float -10.0 10.0) x)
(type (double-float -1.0d100 1.0d100) y))
(* x y)))
1.0f0 1.0d0)
1.0d0)
t)
(deftest *.27
(loop
for type in '(short-float single-float double-float long-float)
for bits in '(13 24 50 50)
for bound = (ash 1 (floor bits 2))
nconc
(loop for i = (random bound)
for x = (coerce i type)
for j = (random bound)
for y = (coerce j type)
for one = (coerce 1.0 type)
for cx = (complex 1.0 x)
for cy = (complex 1.0 y)
for prod = (* cx cy)
repeat 10000
unless (and (eql prod (complex (coerce (- 1 (* i j)) type)
(coerce (+ i j) type)))
(eql prod (* cy cx)))
collect (list i j x y (* cx cy))))
nil)
(deftest times.order.1
(let ((i 0) x y)
(values
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment