--- a/SmallInteger.st Mon May 25 02:51:46 2015 +0100
+++ b/SmallInteger.st Mon May 25 06:37:39 2015 +0200
@@ -3936,7 +3936,61 @@
|s|
%{
-#ifndef __SCHTEAM__
+#ifdef __SCHTEAM__
+ int __base = base.intValue();
+ long myValue = self.longValue();
+ java.lang.String __s;
+
+ switch (__base) {
+ case 2:
+ __s = java.lang.Long.toBinaryString(myValue);
+ break;
+
+ case 8:
+ __s = java.lang.Long.toOctalString(myValue);
+ break;
+
+ case 10:
+ __s = java.lang.Long.toString(myValue);
+ break;
+
+ case 16:
+ __s = java.lang.Long.toHexString(myValue);
+ break;
+
+ default:
+ {
+ boolean negative = false;
+ __s = "";
+
+ if ((__base > 36) || (__base < 2)) {
+ throw new SmalltalkError("invalid base: ", base);
+ }
+ if (myValue < 0) {
+ negative = true;
+ myValue = -myValue;
+ }
+ while (myValue != 0) {
+ int digit;
+ char ch;
+
+ digit = (int)(myValue % __base);
+ if (digit <= 9) {
+ ch = (char)('0' + digit);
+ } else {
+ ch = (char)('A' + digit - 10);
+ }
+ __s = ch + __s;
+ myValue = myValue / __base;
+ }
+ if (negative) {
+ __s = "-" + __s;
+ }
+ break;
+ }
+ }
+ return context._RETURN( new STString( __s ));
+#else
char buffer[64+3]; /* for 64bit machines, base 2, plus sign, plus 0-byte */
char *cp;
OBJ newString;
@@ -4887,11 +4941,11 @@
!SmallInteger class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.237 2015-05-23 14:09:31 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.238 2015-05-24 12:52:47 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.237 2015-05-23 14:09:31 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.238 2015-05-24 12:52:47 cg Exp $'
! !