Integer.st
changeset 3136 91dbf1ea13a6
parent 3135 8c0f47cf59e3
child 3138 1cd38a2d1924
--- a/Integer.st	Fri Dec 19 09:38:43 1997 +0100
+++ b/Integer.st	Fri Dec 19 15:21:25 1997 +0100
@@ -1132,7 +1132,7 @@
     "return a string representation of the receiver in the specified
      radix (without the initial XXr)"
 
-    |num s divMod mod r nD numN|
+    |num s divMod mod r r2 r4 nD numN|
 
     (aRadix between:2 and:36) ifFalse:[
 	self error:'invalid radix'.
@@ -1161,18 +1161,18 @@
     s := WriteStream on:''.
 
     "/ instead of computing the quotient and remainder
-    "/ against radix, do it in junks of 5 or 8 digits.
+    "/ against radix, do it in junks of 5 or 6 digits.
     "/ This reduces the number of LargeInt-divisions
     "/ by that factor (turning them into smallInt divisions
     "/ within that junk) and speeds up the conversions noticably.
 
-    r := aRadix*aRadix.   "/ radix^2
-    r := r*r.             "/ radix^4
+    r2 := aRadix*aRadix.   "/ radix^2
+    r4 := r*r.             "/ radix^4
     aRadix <= 10 ifTrue:[
-	r := r*r.         "/ radix^8
-	nD := 8.
+	r := r4*r2.        "/ radix^6
+	nD := 6.
     ] ifFalse:[
-	r := r*aRadix.    "/ radix^5
+	r := r4*aRadix.    "/ radix^5
 	nD := 5.
     ].
 
@@ -1466,5 +1466,5 @@
 !Integer class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.73 1997-12-19 08:38:00 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.74 1997-12-19 14:21:25 cg Exp $'
 ! !