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
ansi-test
ansi-test
Commits
ac9cca4b
Commit
ac9cca4b
authored
Sep 29, 2019
by
Marius Gerbershagen
Browse files
expt: add type contagion test for (expt 0 y) with (realpart y)>0
parent
9f06631f
Changes
1
Hide whitespace changes
Inline
Side-by-side
numbers/expt.lsp
View file @
ac9cca4b
...
...
@@ -218,12 +218,25 @@
(<= (realpart (expt -8 1/3)) 0.0)
nil)
(deftest expt.29
;; type contagion test for (expt 0 y) with (realpart y)>0
(loop for x in '(0 0.0f0 0.0d0 0.0l0
#C(0.0f0 0.0f0) #C(0.0d0 0.0d0) #C(0.0l0 0.0l0))
append
(loop
for y in '(2 2.0f0 2.0d0 2.0l0
#C(2 2) #C(2 1/2)
#C(2.0f0 0.5f0) #C(2.0d0 0.5d0) #C(2.0l0 0.5l0))
unless (eql (* x y) (expt x y))
collect (list x y (expt x y))))
nil)
#|
;;; FIXME
;;; I need to think more about how to do approximate float
;;; equality in a principled way.
(deftest expt.
29
(deftest expt.
30
(loop for bound in '(1.0s4 1.0f6 1.0d8 1.0l8)
for ebound in (list short-float-epsilon single-float-epsilon
double-float-epsilon long-float-epsilon)
...
...
@@ -238,7 +251,7 @@
collect (list x s1 s2)))
nil)
(deftest expt.3
0
(deftest expt.3
1
(loop for bound in '(1.0s4 1.0f6 1.0d8 1.0l8)
for ebound in (list short-float-epsilon single-float-epsilon
double-float-epsilon long-float-epsilon)
...
...
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