#| -*-Scheme-*-
-$Id: arith.scm,v 1.32 1995/05/10 03:33:08 adams Exp $
+$Id: arith.scm,v 1.33 1995/11/03 22:44:19 adams Exp $
Copyright (c) 1989-94 Massachusetts Institute of Technology
;; performance would move the barriers around.
(define (int:->string number radix)
- (define-integrable (digits->string value digits)
+ (define (digits->string value digits)
(list->string
(if (eq? number value)
digits
(digits->string
value
(let loop ((n value) (tail '()))
- (cond ((not (int:zero? n))
- (let ((qr (integer-divide n radix)))
- (loop (integer-divide-quotient qr)
- (cons (digit->char (integer-divide-remainder qr)
- radix)
- tail))))
- ((null? tail)
- '(#\0))
- (else
- tail)))))
+ (if (fix:fixnum? n)
+ (let fixnum-loop ((n n) (tail tail))
+ (cond ((not (fix:zero? n))
+ (fixnum-loop (fix:quotient n radix)
+ (cons (digit->char (fix:remainder n radix)
+ radix)
+ tail)))
+ ((null? tail)
+ '(#\0))
+ (else
+ tail)))
+ (let ((qr (integer-divide n radix)))
+ (loop (integer-divide-quotient qr)
+ (cons (digit->char (integer-divide-remainder qr)
+ radix)
+ tail)))))))
\f
(define (print-medium value)
(digits->string value