From ec21bae51997b55d81bb369a3eac885caabfde56 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 1 May 2018 23:36:10 -0700 Subject: [PATCH] Change rational? to be false for inf/nan. --- src/runtime/arith.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/arith.scm b/src/runtime/arith.scm index 5fd209f29..87e6c11b5 100644 --- a/src/runtime/arith.scm +++ b/src/runtime/arith.scm @@ -925,7 +925,9 @@ USA. (real:= 1 x))) (define (real:rational? x) - (if (flonum? x) #t (rat:rational? x))) + (if (flonum? x) + (not (or (flo:nan? x) (flo:infinite? x))) + (rat:rational? x))) (define (real:integer? x) (if (flonum? x) (flo:integer? x) ((copy rat:integer?) x))) -- 2.25.1