1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 16:50:21 +02:00

(inexact->exact): New tests.

This commit is contained in:
Kevin Ryde 2003-10-09 00:41:15 +00:00
parent 2be24db4d7
commit 1259cb26f7

View file

@ -2072,6 +2072,24 @@
;;; inexact->exact ;;; inexact->exact
;;; ;;;
(with-test-prefix "inexact->exact"
(pass-if-exception exception:numerical-overflow "+inf"
(inexact->exact +.inf))
(pass-if-exception exception:numerical-overflow "-inf"
(inexact->exact -.inf))
(pass-if-exception exception:numerical-overflow "nan"
(inexact->exact +.nan))
(with-test-prefix "2.0**i to exact and back"
(do ((i 0 (1+ i))
(n 1.0 (* 2.0 n)))
((> i 100))
(pass-if (list i n)
(= n (inexact->exact (exact->inexact n)))))))
;;; ;;;
;;; integer-length ;;; integer-length
;;; ;;;