From 51bc96f84c204865d7d0e556e4cf4d2a9d0f3ffd Mon Sep 17 00:00:00 2001 From: "Arthur A. Gleckler" Date: Wed, 1 Sep 2010 22:43:46 -0700 Subject: [PATCH] Added trivial tests for conversion to floating-point infinities by `cast-integer-to-ieee754-single' and `cast-integer-to-ieee754-double'. --- tests/microcode/test-flonum-casts.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/microcode/test-flonum-casts.scm b/tests/microcode/test-flonum-casts.scm index 0d933e665..864522c36 100644 --- a/tests/microcode/test-flonum-casts.scm +++ b/tests/microcode/test-flonum-casts.scm @@ -84,6 +84,17 @@ USA. -1.0 #*1011111111110000000000000000000000000000000000000000000000000000) + ;; We should a procedure that tests for floating-point infinity + ;; and use it here. + (let ((positive-infinity + (integer-to-double + #*0111111111110000000000000000000000000000000000000000000000000000))) + (assert-true (flo:positive? positive-infinity))) + (let ((negative-infinity + (integer-to-double + #*1111111111110000000000000000000000000000000000000000000000000000))) + (assert-true (flo:negative? negative-infinity))) + (assert-true (flo:nan? (integer-to-double @@ -127,6 +138,15 @@ USA. (test-single -1.0 #*10111111100000000000000000000000) + ;; We should a procedure that tests for floating-point infinity + ;; and use it here. + (let ((positive-infinity + (integer-to-single #*01111111100000000000000000000000))) + (assert-true (flo:positive? positive-infinity))) + (let ((negative-infinity + (integer-to-single #*11111111100000000000000000000000))) + (assert-true (flo:negative? negative-infinity))) + (assert-true (flo:nan? (integer-to-single -- 2.25.1