Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ansi-test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Gary Palter
ansi-test
Commits
c805bab9
Commit
c805bab9
authored
Dec 22, 2016
by
Daniel Kochmański
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
numbers: atan: test signed zero case
parent
a212df0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
atan.lsp
numbers/atan.lsp
+26
-9
No files found.
numbers/atan.lsp
View file @
c805bab9
...
...
@@ -155,16 +155,34 @@
(remove-if #'zerop *floats*)))))
T)
;;; We could have tested also for infinities and signed 0, but there
;;; is no portable ieee-fp, we could put it in ansi-beyond test suite
(deftest atan.ieee.2 :description "Verify ATAN handling signed zero"
(or (plusp (float-sign -0.0))
(flet ((-zerop (elt)
(and (zerop elt)
(minusp (float-sign elt))))
(+zerop (elt)
(and (zerop elt)
(plusp (float-sign elt))))
(-pi-p (elt) (< (abs (+ pi elt)) 0.01))
(+pi-p (elt) (< (abs (- pi elt)) 0.01)))
(and
(+zerop (atan +0.0 +0.0))
(-zerop (atan -0.0 +0.0))
(+pi-p (atan +0.0 -0.0))
(-pi-p (atan -0.0 -0.0))
(every #'identity
(map 'list (lambda (n)
(and (-zerop (atan -0.0 n))
(+zerop (atan +0.0 n))
(+pi-p (atan +0.0 (- n)))
(-pi-p (atan -0.0 (- n)))))
(remove-if-not #'plusp *floats*))))))
T)
;;; We could have tested also for infinities and nan's, but there is
;;; no portable ieee-fp, we could put it in ansi-beyond test suite
;;; though:
;;;
;;; (atan +0.0 -anything-but-0/nan/inf) -> +pi
;;; (atan -0.0 -anything-but-0/nan/inf) -> -pi
;;; (atan +0.0 +0.0) -> +0.0
;;; (atan -0.0 +0.0) -> -0.0
;;; (atan +0.0 -0.0) -> +pi
;;; (atan -0.0 -0.0) -> -pi
;;; (atan (anything) nan) -> nan
;;; (atan nan (anything)) -> nan
;;; (atan +-inf +inf) -> +-pi/4
...
...
@@ -173,7 +191,6 @@
;;; (atan +-(anything-but-inf/nan), -inf) -> +-pi
;;; (atan +-inf (anything-but-0/nan/inf)) -> +-pi/2
;;;
;;; (deftest atan.ieee.2 t t)
;;; Error tests
...
...
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