*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Thu, 18 Sep 1997 22:12:16 +0200
changeset 2951 256e90eee7f9
parent 2950 d5fae0fb75d7
child 2952 2cf2ae894c4d
*** empty log message ***
FileDir.st
FileDirectory.st
Integer.st
--- a/FileDir.st	Thu Sep 18 22:11:04 1997 +0200
+++ b/FileDir.st	Thu Sep 18 22:12:16 1997 +0200
@@ -84,7 +84,7 @@
 currentDirectory
     "create and return a new FileDirectory for the current directory"
 
-    self obsoleteMethodWarning:'use Filename'.
+    "/ self obsoleteMethodWarning:'use Filename'.
     ^ (self basicNew) pathName:(Filename currentDirectory name)
 
     "
@@ -99,7 +99,7 @@
     "create and return a new FileDirectory for the directory
      with given pathname"
 
-    self obsoleteMethodWarning:'use Filename'.
+    "/ self obsoleteMethodWarning:'use Filename'.
     name asString = '.' ifTrue:[
 	Filename currentDirectory name ~= '.' ifTrue:[
 	    ^ self currentDirectory
@@ -119,7 +119,7 @@
 
     |baseName sep|
 
-    self obsoleteMethodWarning:'use Filename'.
+    "/ self obsoleteMethodWarning:'use Filename'.
 
 "/ OLD:
 "/    sep := OperatingSystem fileSeparator.
@@ -168,7 +168,7 @@
 rootDirectory
     "create and return a new FileDirectory for the root directory"
 
-    self obsoleteMethodWarning:'use Filename'.
+    "/ self obsoleteMethodWarning:'use Filename'.
     ^ (self basicNew) pathName:(Filename rootDirectory name)
 
     "
@@ -673,6 +673,6 @@
 !FileDirectory class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/FileDir.st,v 1.32 1997-09-15 20:34:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/FileDir.st,v 1.33 1997-09-18 20:12:15 cg Exp $'
 ! !
 FileDirectory initialize!
--- a/FileDirectory.st	Thu Sep 18 22:11:04 1997 +0200
+++ b/FileDirectory.st	Thu Sep 18 22:12:16 1997 +0200
@@ -84,7 +84,7 @@
 currentDirectory
     "create and return a new FileDirectory for the current directory"
 
-    self obsoleteMethodWarning:'use Filename'.
+    "/ self obsoleteMethodWarning:'use Filename'.
     ^ (self basicNew) pathName:(Filename currentDirectory name)
 
     "
@@ -99,7 +99,7 @@
     "create and return a new FileDirectory for the directory
      with given pathname"
 
-    self obsoleteMethodWarning:'use Filename'.
+    "/ self obsoleteMethodWarning:'use Filename'.
     name asString = '.' ifTrue:[
 	Filename currentDirectory name ~= '.' ifTrue:[
 	    ^ self currentDirectory
@@ -119,7 +119,7 @@
 
     |baseName sep|
 
-    self obsoleteMethodWarning:'use Filename'.
+    "/ self obsoleteMethodWarning:'use Filename'.
 
 "/ OLD:
 "/    sep := OperatingSystem fileSeparator.
@@ -168,7 +168,7 @@
 rootDirectory
     "create and return a new FileDirectory for the root directory"
 
-    self obsoleteMethodWarning:'use Filename'.
+    "/ self obsoleteMethodWarning:'use Filename'.
     ^ (self basicNew) pathName:(Filename rootDirectory name)
 
     "
@@ -673,6 +673,6 @@
 !FileDirectory class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.32 1997-09-15 20:34:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/FileDirectory.st,v 1.33 1997-09-18 20:12:15 cg Exp $'
 ! !
 FileDirectory initialize!
--- a/Integer.st	Thu Sep 18 22:11:04 1997 +0200
+++ b/Integer.st	Thu Sep 18 22:12:16 1997 +0200
@@ -1107,7 +1107,7 @@
     "return a string representation of the receiver in the specified
      radix (without the initial XXr)"
 
-    |num s divMod div mod|
+    |num s divMod mod r5 num5|
 
     (aRadix between:2 and:36) ifFalse:[
         self error:'invalid radix'.
@@ -1131,19 +1131,36 @@
 "/    ^ (Character digitValue:self) asString
 
     num := self.
-    divMod := num divMod:aRadix.
-    div := divMod at:1.
-    mod := divMod at:2.
+    num = 0 ifTrue:[^ '0'].
+
+    s := ''.
+
+    r5 := aRadix*aRadix.
+    r5 := r5*r5.
+    r5 := r5*aRadix.
 
-    s := (Character digitValue:mod) asString.
-    num := div.
+    [num >= r5] whileTrue:[
+	"/
+	"/ chop off 5 digits.
+	"/
+	divMod := num divMod:r5.
+	num := divMod at:1.
+	num5 := divMod at:2.
+
+	"/ process them
+	5 timesRepeat:[
+            divMod := num5 divMod:aRadix.
+            num5 := divMod at:1.
+            mod := divMod at:2.
+            s := (Character digitValue:mod) asString , s.
+	].
+    ].
 
     [num ~= 0] whileTrue:[
         divMod := num divMod:aRadix.
-        div := divMod at:1.
+        num := divMod at:1.
         mod := divMod at:2.
         s := (Character digitValue:mod) asString , s.
-        num := div.
     ].
     ^ s
 
@@ -1155,11 +1172,12 @@
      radix. The string is padded on the left with fillCharacter to make
      its size as specified in sz."
 
-    |s|
+    |s actualSize|
 
     s := self printStringRadix:aRadix.
-    s size < sz ifTrue:[
-	s := ((String new:(sz - s size)) atAllPut:fillCharacter) , s
+    actualSize := s size.
+    actualSize < sz ifTrue:[
+	s := ((String new:(sz - actualSize)) atAllPut:fillCharacter) , s
     ].
     ^ s
 
@@ -1393,5 +1411,5 @@
 !Integer class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.67 1997-07-31 11:20:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.68 1997-09-18 20:12:16 cg Exp $'
 ! !