infinities are not rational

This commit is contained in:
Alex Shinn 2011-11-27 21:40:50 +09:00
parent a1057fa88e
commit b84dba8425

View file

@ -952,9 +952,10 @@
(define (number? x) (if (inexact? x) #t (exact? x)))
(define complex? number?)
(cond-expand
(complex (define (rational? x) (and (number? x) (not (%complex? x)))))
(else (define rational? number?)))
(define real? rational?)
(complex (define (real? x) (and (number? x) (not (%complex? x)))))
(else (define real? number?)))
(define (rational? x)
(and (real? x) (= x x) (not (= x (+ x (if (positive? x) 1 -1))))))
(define (exact-integer-sqrt x)
(let ((res (sqrt x)))