Integer.st
changeset 3138 1cd38a2d1924
parent 3136 91dbf1ea13a6
child 3162 c7c8af356ff2
--- a/Integer.st	Tue Dec 23 18:08:49 1997 +0100
+++ b/Integer.st	Tue Dec 23 18:09:33 1997 +0100
@@ -1135,13 +1135,13 @@
     |num s divMod mod r r2 r4 nD numN|
 
     (aRadix between:2 and:36) ifFalse:[
-	self error:'invalid radix'.
-	^ self printStringRadix:10
+        self error:'invalid radix'.
+        ^ self printStringRadix:10
     ].
 
     (self = 0) ifTrue:[^ '0'].
     (self < 0) ifTrue:[
-	^ '-' , (self negated printStringRadix:aRadix)
+        ^ '-' , (self negated printStringRadix:aRadix)
     ].
 
     "
@@ -1167,37 +1167,37 @@
     "/ within that junk) and speeds up the conversions noticably.
 
     r2 := aRadix*aRadix.   "/ radix^2
-    r4 := r*r.             "/ radix^4
+    r4 := r2*r2.             "/ radix^4
     aRadix <= 10 ifTrue:[
-	r := r4*r2.        "/ radix^6
-	nD := 6.
+        r := r4*r2.        "/ radix^6
+        nD := 6.
     ] ifFalse:[
-	r := r4*aRadix.    "/ radix^5
-	nD := 5.
+        r := r4*aRadix.    "/ radix^5
+        nD := 5.
     ].
 
     [num >= r] whileTrue:[
-	"/
-	"/ chop off nD digits.
-	"/
-	divMod := num divMod:r.
-	num := divMod at:1.
-	numN := divMod at:2.
+        "/
+        "/ chop off nD digits.
+        "/
+        divMod := num divMod:r.
+        num := divMod at:1.
+        numN := divMod at:2.
 
-	"/ process them
-	nD timesRepeat:[
-	    divMod := numN divMod:aRadix.
-	    numN := divMod at:1.
-	    mod := divMod at:2.
-	    s nextPut: (Character digitValue:mod).
-	].
+        "/ process them
+        nD timesRepeat:[
+            divMod := numN divMod:aRadix.
+            numN := divMod at:1.
+            mod := divMod at:2.
+            s nextPut: (Character digitValue:mod).
+        ].
     ].
 
     [num ~= 0] whileTrue:[
-	divMod := num divMod:aRadix.
-	num := divMod at:1.
-	mod := divMod at:2.
-	s nextPut: (Character digitValue:mod).
+        divMod := num divMod:aRadix.
+        num := divMod at:1.
+        mod := divMod at:2.
+        s nextPut: (Character digitValue:mod).
     ].
     ^ s contents reverse
 
@@ -1466,5 +1466,5 @@
 !Integer class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.74 1997-12-19 14:21:25 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.75 1997-12-23 17:09:33 ca Exp $'
 ! !