bignums (10^1000), up to 2x-3x faster for small bignums (up to
10^100), slightly faster for fixnums.
. Use a local version of DIGIT->CHAR since we don't need to check the
radix.
. PRINT-FIXNUM modified to be useful for generating digits in the
middle of a number.
. PRINT-MEDIUM and PRINT-LARGE work in units of several digits, the
length of a unit pre-computed so that a unit can be printed using
fixnum arithmetic.
. PRINT-MEDIUM chops off groups of digits that can be printed by
PRINT-FIXNUM. The microcode primitive LISTIFY-BIGNUM is no longer
used.
. PRINT-LARGE has a special check to try to avoid the last multiply
in building the power stack (which is asymptotically 2/3 of the
cost of building the stack). The recursion termination check is
generalized to also catch sequences of digits with enough leading
zeroes to be formatted by PRINT-FIXNUM (this can double the speed
of printing numbers with many zeros).
#| -*-Scheme-*-
-$Id: arith.scm,v 1.41 1997/07/07 20:24:45 adams Exp $
+$Id: arith.scm,v 1.42 1997/07/08 01:22:28 adams Exp $
Copyright (c) 1989-97 Massachusetts Institute of Technology
(set! *maximum-fixnum-radix-powers*
(make-initialized-vector 37
(lambda (radix)
- (and (fix:> radix 2)
+ (and (fix:>= radix 2)
(let loop ((digits 0) (factor 1))
(let ((nf (int:* factor radix)))
(if (fix:fixnum? nf)