Skip to content
Snippets Groups Projects
Commit 088b55ec authored by pfdietz's avatar pfdietz
Browse files

Yet more EXPT tests.

parent b3a8c2e3
No related branches found
No related tags found
No related merge requests found
......@@ -84,5 +84,97 @@
always (eql (expt c 0) #c(1.0l0 0.0l0)))
t)
(deftest expt.12
(loop for x in *numbers*
unless (or (floatp (realpart x))
(eql (expt x 1) x))
collect x)
nil)
(deftest expt.13
(loop for x in *rationals*
unless (and (eql (expt x 2) (* x x))
(or (zerop x)
(eql (expt x -1) (/ x))))
collect x)
nil)
(deftest expt.14
(expt #c(0 2) 2)
-4)
(deftest expt.15
(expt #c(1 1) 2)
#c(0 2))
(deftest expt.16
(expt #c(1/2 1/3) 3)
#c(-1/24 23/108))
(deftest expt.17
(expt #c(1 1) -2)
#c(0 -1/2))
(deftest expt.18
(loop
for zero in '(0.0s0 0.0f0 0.0d0 0.0l0)
always
(loop for i from -1000 to 1000
always (eql (expt i zero) (float 1 zero))))
t)
(deftest expt.19
(loop
for zero in '(0.0s0 0.0f0 0.0d0 0.0l0)
always
(loop for i from -1000 to 1000
always (eql (expt (float i 0.0s0) zero) (float 1 zero))))
t)
(deftest expt.20
(loop
for zero in '(0.0f0 0.0d0 0.0l0)
always
(loop for i from -1000 to 1000
always (eql (expt (float i 0.0f0) zero) (float 1 zero))))
t)
(deftest expt.21
(loop
for zero in '(0.0d0 0.0l0)
always
(loop for i from -1000 to 1000
always (eql (expt (float i 0.0d0) zero) (float 1 zero))))
t)
(deftest expt.22
(expt 2.0f0 0.0s0)
1.0f0)
(deftest expt.23
(expt 2.0d0 0.0s0)
1.0d0)
(deftest expt.24
(expt 2.0l0 0.0s0)
1.0l0)
(deftest expt.25
(expt 2.0d0 0.0f0)
1.0d0)
(deftest expt.26
(expt 2.0l0 0.0f0)
1.0l0)
(deftest expt.27
(expt 2.0l0 0.0d0)
1.0l0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment