protect nan? test by real?, as Aziz points out; also fix nan?, finite?, and infinite? to insist on real arguments
svn: r10869
This commit is contained in:
parent
4947ae6711
commit
fe84c8c6a3
|
@ -195,16 +195,22 @@
|
|||
(integer? (real-part o)))))
|
||||
|
||||
(define (finite? n)
|
||||
(not (or (eqv? n +inf.0)
|
||||
(eqv? n -inf.0)
|
||||
(eqv? n +nan.0))))
|
||||
(if (real? n)
|
||||
(not (or (eqv? n +inf.0)
|
||||
(eqv? n -inf.0)
|
||||
(eqv? n +nan.0)))
|
||||
(raise-type-error 'infinite? "real" n)))
|
||||
|
||||
(define (infinite? n)
|
||||
(or (eqv? n +inf.0)
|
||||
(eqv? n -inf.0)))
|
||||
(if (real? n)
|
||||
(or (eqv? n +inf.0)
|
||||
(eqv? n -inf.0))
|
||||
(raise-type-error 'infinite? "real" n)))
|
||||
|
||||
(define (nan? n)
|
||||
(eqv? n +nan.0))
|
||||
(if (real? n)
|
||||
(eqv? n +nan.0)
|
||||
(raise-type-error 'nan? "real" n)))
|
||||
|
||||
;; Someone needs to look more closely at div and mod.
|
||||
;; I started with the code from Enger04, and poked it
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
(set! checked (+ 1 checked))
|
||||
(unless (if (and (real? expected)
|
||||
(nan? expected))
|
||||
(nan? got)
|
||||
(and (real? got) (nan? got))
|
||||
(or (equal? got expected)
|
||||
(and (expected-exception? expected)
|
||||
(expected-exception? got))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user