From: Chris Hanson Date: Wed, 2 May 2018 06:36:10 +0000 (-0700) Subject: Change rational? to be false for inf/nan. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~83 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ec21bae51997b55d81bb369a3eac885caabfde56;p=mit-scheme.git Change rational? to be false for inf/nan. --- 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)))