From: Arthur A. Gleckler Date: Thu, 2 Sep 2010 05:43:46 +0000 (-0700) Subject: Added trivial tests for conversion to floating-point infinities by X-Git-Tag: 20101212-Gtk~69 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=51bc96f84c204865d7d0e556e4cf4d2a9d0f3ffd;p=mit-scheme.git Added trivial tests for conversion to floating-point infinities by `cast-integer-to-ieee754-single' and `cast-integer-to-ieee754-double'. --- 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