mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 21:59:17 +02:00
infinities are not rational
This commit is contained in:
parent
a1057fa88e
commit
b84dba8425
1 changed files with 4 additions and 3 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Reference in a new issue