flfinite? applied to a NaN returns false.

Fixes <http://bugs.gnu.org/14868>.
Reported by Göran Weinholt <goran@weinholt.se>.

* module/rnrs/arithmetic/flonums.scm (flfinite?): If the argument is a
  NaN, return false.

* test-suite/tests/r6rs-arithmetic-flonums.test (flfinite?): Add test.
This commit is contained in:
Mark H Weaver 2013-07-16 03:42:52 -04:00
commit 85b32d43e6
2 changed files with 5 additions and 2 deletions

View file

@ -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))