From d8b1c640447ac28ea21309f5605aff82591711b6 Mon Sep 17 00:00:00 2001 From: sperber Date: Fri, 5 Jan 2007 09:43:28 +0000 Subject: [PATCH] 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. --- scheme/bcomp/comp-prim.scm | 4 ++-- scheme/rts/xnum.scm | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scheme/bcomp/comp-prim.scm b/scheme/bcomp/comp-prim.scm index 6fb60a6..843ea1c 100644 --- a/scheme/bcomp/comp-prim.scm +++ b/scheme/bcomp/comp-prim.scm @@ -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) diff --git a/scheme/rts/xnum.scm b/scheme/rts/xnum.scm index 402f1e3..208b614 100644 --- a/scheme/rts/xnum.scm +++ b/scheme/rts/xnum.scm @@ -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.