* Fixed two bugs in $ratnum-n and $ratnum-d

This commit is contained in:
Abdulaziz Ghuloum 2007-06-08 10:30:25 +03:00
parent 3798fd932a
commit 6712e9490b
3 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@ -568,6 +568,8 @@
(cond
[(fixnum? x) (fixnum->flonum x)]
[(bignum? x) (bignum->flonum x)]
[(ratnum? x)
(binary/ (exact->inexact ($ratnum-n x)) ($ratnum-d x))]
[else
(error 'exact->inexact
"~s is not an exact number" x)])))

View File

@ -761,10 +761,10 @@
(define-primop $ratnum-n unsafe
[(V x) (prm 'mref (T x) (K (- vector-tag disp-ratnum-num)))])
[(V x) (prm 'mref (T x) (K (- disp-ratnum-num vector-tag)))])
(define-primop $ratnum-d unsafe
[(V x) (prm 'mref (T x) (K (- vector-tag disp-ratnum-den)))])
[(V x) (prm 'mref (T x) (K (- disp-ratnum-den vector-tag)))])
/section)