Merge from tuebingen/trunk (needed for upcoming fixes to SRFI 19):

r568 | sperber | 2003-12-01 22:42:06 +0100 (Mon, 01 Dec 2003) | 4 lines
Changed paths:
   M /s48/tuebingen/trunk/scheme/bcomp/comp-prim.scm
   M /s48/tuebingen/trunk/scheme/rts/xnum.scm

Subject: Make INEXACT->EXACT work on exacts and vice versa

As discussed on the Scheme 48 mailing list, and requested by jar.
This commit is contained in:
sperber 2007-01-05 09:43:28 +00:00
parent 640281efcb
commit d8b1c64044
2 changed files with 5 additions and 2 deletions

View File

@ -74,9 +74,9 @@
(exact?
,(proc (number-type) boolean-type))
(exact->inexact
,(proc (exact-type) inexact-type))
,(proc (number-type) inexact-type))
(inexact->exact
,(proc (inexact-type) exact-type))
,(proc (number-type) exact-type))
((exp log sin cos tan asin acos sqrt)
,(proc (number-type) number-type))
((atan)

View File

@ -216,9 +216,12 @@
(define-simple-type :exact (:number)
(lambda (n) (and (number? n) (exact? n))))
(define-method &inexact->exact ((n :exact)) n)
(define-simple-type :inexact (:number)
(lambda (n) (and (number? n) (inexact? n))))
(define-method &exact->inexact ((n :inexact)) n)
; Whattakludge.