Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gary Palter
ansi-test
Commits
e009b4e1
Commit
e009b4e1
authored
May 08, 2004
by
pfdietz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed possible 0 lossage in log tests
parent
d34845d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
+22
-12
ansi-tests/log.lsp
ansi-tests/log.lsp
+22
-12
No files found.
ansi-tests/log.lsp
View file @
e009b4e1
...
...
@@ -43,55 +43,65 @@
(deftest log.5
(loop for type in '(short-float single-float double-float long-float)
for zero = (coerce 0 type)
nconc
(loop
for x = (- (random (coerce 1 type)))
for rlist = (
multiple-value-list (log x
))
for rlist = (
and (/= x zero) (multiple-value-list (log x)
))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y `(complex ,type)))
unless (or (= x zero)
(and (null (cdr rlist))
(typep y `(complex ,type))))
collect (list x rlist)))
nil)
(deftest log.6
(loop for type in '(short-float single-float double-float long-float)
for zero = (coerce 0 type)
nconc
(loop
for x = (- (random (coerce 1000000 type)))
for rlist = (
multiple-value-list (log x
))
for rlist = (
and (/= x zero) (multiple-value-list (log x)
))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y `(complex ,type)))
unless (or (= x zero)
(and (null (cdr rlist))
(typep y `(complex ,type))))
collect (list x rlist)))
nil)
(deftest log.7
(loop for type in '(short-float single-float double-float long-float)
for zero = (coerce 0 type)
nconc
(loop
for x1 = (- (random (coerce 2000 type)) 1000)
for x2 = (1+ (random (coerce 1000 type)))
for rlist = (multiple-value-list (log (complex x1 x2)))
for rlist = (and (/= x1 zero)
(multiple-value-list (log (complex x1 x2))))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y `(complex ,type)))
unless (or (= x1 zero)
(and (null (cdr rlist))
(typep y `(complex ,type))))
collect (list x1 x2 rlist)))
nil)
(deftest log.8
(loop for type in '(short-float single-float double-float long-float)
for zero = (coerce 0 type)
nconc
(loop
for x1 = (- (random (coerce 2000 type)) 1000)
for x2 = (- -1 (random (coerce 1000 type)))
for rlist = (multiple-value-list (log (complex x1 x2)))
for rlist = (and (/= x1 zero)
(multiple-value-list (log (complex x1 x2))))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y `(complex ,type)))
unless (or (= x1 zero)
(and (null (cdr rlist))
(typep y `(complex ,type))))
collect (list x1 x2 rlist)))
nil)
...
...
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