diff options
-rw-r--r-- | module/rnrs/arithmetic/flonums.scm | 2 | ||||
-rw-r--r-- | test-suite/tests/r6rs-arithmetic-flonums.test | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/module/rnrs/arithmetic/flonums.scm b/module/rnrs/arithmetic/flonums.scm index 60d6cf6e2..be59295a7 100644 --- a/module/rnrs/arithmetic/flonums.scm +++ b/module/rnrs/arithmetic/flonums.scm @@ -89,7 +89,7 @@ (define (flnegative? fl) (assert-flonum fl) (negative? fl)) (define (flodd? ifl) (assert-iflonum ifl) (odd? ifl)) (define (fleven? ifl) (assert-iflonum ifl) (even? ifl)) - (define (flfinite? fl) (assert-flonum fl) (not (inf? fl))) + (define (flfinite? fl) (assert-flonum fl) (not (or (inf? fl) (nan? fl)))) (define (flinfinite? fl) (assert-flonum fl) (inf? fl)) (define (flnan? fl) (assert-flonum fl) (nan? fl)) diff --git a/test-suite/tests/r6rs-arithmetic-flonums.test b/test-suite/tests/r6rs-arithmetic-flonums.test index c5d60cec1..0be504f5f 100644 --- a/test-suite/tests/r6rs-arithmetic-flonums.test +++ b/test-suite/tests/r6rs-arithmetic-flonums.test @@ -142,7 +142,10 @@ (flfinite? 2.0)) (pass-if "flfinite? is #f on infinities" - (and (not (flfinite? +inf.0)) (not (flfinite? -inf.0))))) + (and (not (flfinite? +inf.0)) (not (flfinite? -inf.0)))) + + (pass-if "flfinite? is #f on NaNs" + (not (flfinite? +nan.0)))) (with-test-prefix "flinfinite?" (pass-if "flinfinite? is #t on infinities" |