Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ansi-test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ansi-test
ansi-test
Commits
ac9cca4b
Commit
ac9cca4b
authored
Sep 29, 2019
by
Marius Gerbershagen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expt: add type contagion test for (expt 0 y) with (realpart y)>0
parent
9f06631f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
numbers/expt.lsp
numbers/expt.lsp
+15
-2
No files found.
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