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
b649f246
Commit
b649f246
authored
Feb 12, 2004
by
pfdietz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for LOG (not complete)
parent
a3fceffb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
0 deletions
+114
-0
ansi-tests/load-numbers.lsp
ansi-tests/load-numbers.lsp
+1
-0
ansi-tests/log.lsp
ansi-tests/log.lsp
+113
-0
No files found.
ansi-tests/load-numbers.lsp
View file @
b649f246
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
(load "incf.lsp")
(load "incf.lsp")
(load "decf.lsp")
(load "decf.lsp")
(load "lcm.lsp")
(load "lcm.lsp")
(load "log.lsp")
(load "signum.lsp")
(load "signum.lsp")
(load "sqrt.lsp")
(load "sqrt.lsp")
(load "isqrt.lsp")
(load "isqrt.lsp")
...
...
ansi-tests/log.lsp
0 → 100644
View file @
b649f246
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Wed Feb 11 19:53:33 2004
;;;; Contains: Tests of LOG
(in-package :cl-test)
(deftest log.1
(let ((result (log 1)))
(or (eqlt result 0)
(eqlt result 0.0)))
t)
(deftest log.2
(mapcar #'log '(1.0s0 1.0f0 1.0d0 1.0l0))
(0.0s0 0.0f0 0.0d0 0.0l0))
(deftest log.3
(loop for type in '(short-float single-float double-float long-float)
nconc
(loop
for x = (+ (random (coerce 1 type)) (/ 1 1000))
for rlist = (multiple-value-list (log x))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y type))
collect (list x rlist)))
nil)
(deftest log.4
(loop for type in '(short-float single-float double-float long-float)
nconc
(loop
for x = (1+ (random (coerce 1000000 type)))
for rlist = (multiple-value-list (log x))
for y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y type))
collect (list x rlist)))
nil)
(deftest log.5
(loop for type in '(short-float single-float double-float long-float)
nconc
(loop
for x = (- (random (coerce 1 type)))
for rlist = (multiple-value-list (log x))
for y = (car rlist)
repeat 1000
unless (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)
nconc
(loop
for x = (- (random (coerce 1000000 type)))
for rlist = (multiple-value-list (log x))
for y = (car rlist)
repeat 1000
unless (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)
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 y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y `(complex ,type)))
collect (list x rlist)))
nil)
(deftest log.8
(loop for type in '(short-float single-float double-float long-float)
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 y = (car rlist)
repeat 1000
unless (and (null (cdr rlist))
(typep y `(complex ,type)))
collect (list x rlist)))
nil)
;;; FIXME
;;; Add tests for two-arg calls
;;; FIXME
;;; More accuracy tests here
;;; Error tests
(deftest log.error.1
(signals-error (log) program-error)
t)
(deftest log.error.2
(signals-error (log 1.0 2.0 3.0) program-error)
t)
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