projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ada710
)
Change rational? to be false for inf/nan.
author
Chris Hanson
<org/chris-hanson/cph>
Wed, 2 May 2018 06:36:10 +0000
(23:36 -0700)
committer
Chris Hanson
<org/chris-hanson/cph>
Wed, 2 May 2018 06:36:10 +0000
(23:36 -0700)
src/runtime/arith.scm
patch
|
blob
|
history
diff --git
a/src/runtime/arith.scm
b/src/runtime/arith.scm
index 5fd209f29c500d8f40ec6059764c0baff2b8aa72..87e6c11b5cdb3f02bd0657437e741a7756c40bbe 100644
(file)
--- 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)))