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:
parent
640281efcb
commit
d8b1c64044
|
@ -74,9 +74,9 @@
|
||||||
(exact?
|
(exact?
|
||||||
,(proc (number-type) boolean-type))
|
,(proc (number-type) boolean-type))
|
||||||
(exact->inexact
|
(exact->inexact
|
||||||
,(proc (exact-type) inexact-type))
|
,(proc (number-type) inexact-type))
|
||||||
(inexact->exact
|
(inexact->exact
|
||||||
,(proc (inexact-type) exact-type))
|
,(proc (number-type) exact-type))
|
||||||
((exp log sin cos tan asin acos sqrt)
|
((exp log sin cos tan asin acos sqrt)
|
||||||
,(proc (number-type) number-type))
|
,(proc (number-type) number-type))
|
||||||
((atan)
|
((atan)
|
||||||
|
|
|
@ -216,9 +216,12 @@
|
||||||
(define-simple-type :exact (:number)
|
(define-simple-type :exact (:number)
|
||||||
(lambda (n) (and (number? n) (exact? n))))
|
(lambda (n) (and (number? n) (exact? n))))
|
||||||
|
|
||||||
|
(define-method &inexact->exact ((n :exact)) n)
|
||||||
|
|
||||||
(define-simple-type :inexact (:number)
|
(define-simple-type :inexact (:number)
|
||||||
(lambda (n) (and (number? n) (inexact? n))))
|
(lambda (n) (and (number? n) (inexact? n))))
|
||||||
|
|
||||||
|
(define-method &exact->inexact ((n :inexact)) n)
|
||||||
|
|
||||||
; Whattakludge.
|
; Whattakludge.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue