Fixes <http://bugs.gnu.org/14866>.
Reported by Göran Weinholt <goran@weinholt.se>.
* module/rnrs/arithmetic/flonums.scm (flonum?): Use 'real?' instead of
'number?'.
* test-suite/tests/r6rs-arithmetic-flonums.test (flonum?): Add tests.
(rnrs lists (6))
(rnrs r5rs (6)))
- (define (flonum? obj) (and (number? obj) (inexact? obj)))
+ (define (flonum? obj) (and (real? obj) (inexact? obj)))
(define (assert-flonum . args)
(or (for-all flonum? args) (raise (make-assertion-violation))))
(define (assert-iflonum . args)
(pass-if "flonum? is #t on flonum"
(flonum? 1.5))
- (pass-if "flonum? is #f on non-flonum"
+ (pass-if "flonum? is #f on complex"
+ (not (flonum? 1.5+0.0i)))
+
+ (pass-if "flonum? is #f on exact integer"
(not (flonum? 3))))
(with-test-prefix "real->flonum"