mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
11 lines
305 B
Scheme
11 lines
305 B
Scheme
|
|
(define (nan? x)
|
|
(and (real? x) (not (= x x))))
|
|
|
|
(define (finite? x)
|
|
(if (real? x)
|
|
(and (not (nan? x)) (not (= x +inf.0)) (not (= x -inf.0)))
|
|
(and (complex? x) (finite? (real-part x)) (finite? (imag-part x)))))
|
|
|
|
(define (infinite? x)
|
|
(and (number? x) (not (finite? x)) (not (nan? x))))
|