mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
(integer-expt): New tests, of infinite exponents.
(integer?): Exercise nan and +/-inf.
This commit is contained in:
parent
c59e0b9fb1
commit
c1122753ac
1 changed files with 16 additions and 0 deletions
|
@ -1234,6 +1234,9 @@
|
||||||
(pass-if (and (= 3+0i (round 3+0i)) (integer? 3+0i)))
|
(pass-if (and (= 3+0i (round 3+0i)) (integer? 3+0i)))
|
||||||
(pass-if (and (= 1.0 (round 1.0)) (integer? 1.0)))
|
(pass-if (and (= 1.0 (round 1.0)) (integer? 1.0)))
|
||||||
(pass-if (not (integer? 1.3)))
|
(pass-if (not (integer? 1.3)))
|
||||||
|
(pass-if (not (integer? +inf.0)))
|
||||||
|
(pass-if (not (integer? -inf.0)))
|
||||||
|
(pass-if (not (integer? +nan.0)))
|
||||||
(pass-if (not (integer? 3+4i)))
|
(pass-if (not (integer? 3+4i)))
|
||||||
(pass-if (not (integer? #\a)))
|
(pass-if (not (integer? #\a)))
|
||||||
(pass-if (not (integer? "a")))
|
(pass-if (not (integer? "a")))
|
||||||
|
@ -2617,6 +2620,19 @@
|
||||||
(pass-if (list i n)
|
(pass-if (list i n)
|
||||||
(= n (inexact->exact (exact->inexact n)))))))
|
(= n (inexact->exact (exact->inexact n)))))))
|
||||||
|
|
||||||
|
;;;
|
||||||
|
;;; integer-expt
|
||||||
|
;;;
|
||||||
|
|
||||||
|
(with-test-prefix "integer-expt"
|
||||||
|
|
||||||
|
(pass-if-exception "2^+inf" exception:wrong-type-arg
|
||||||
|
(integer-expt 2 +inf.0))
|
||||||
|
(pass-if-exception "2^-inf" exception:wrong-type-arg
|
||||||
|
(integer-expt 2 -inf.0))
|
||||||
|
(pass-if-exception "2^nan" exception:wrong-type-arg
|
||||||
|
(integer-expt 2 +nan.0)))
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
;;; integer-length
|
;;; integer-length
|
||||||
;;;
|
;;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue