I have done a basic arithmetic calculation and got the answer aa
Here is the Smalltalk code in Squeak:
Transcript show: 'aa='.
Transcript show: 23124234 * 431213; cr.
The output is aa=9971470315842
9971470315842 is a decimal number.
What can I do to make a 10-based number displayed based on any integer I want ??
Say, 55-based, 33-based, 2999-base. Any positive integer.
In Squeak, you can use
12345 printStringBase: 17.
'28C3'
You can also prepend the radix (base) and re-interpret the number
17r28C3.
12345
The behavior is well defined up to base 36 (10 digits and 26 latin letters). Then you might get some output with more character codes, but you will not be able to re-interpret the numbers.
This also work with floating point numbers:
Float pi printStringBase: 5.
'3.0323221430334324112412'
5r3.0323221430334324112412.
3.141592653589793
Unfortunately, we can't reinterpret them above base 14 because there is an ambiguity with exponent letter e (once upon a time, only uppercase letters were used as digits, and there were no ambiguity).
Note that you can find methods with the MethodFinder tool.
Open a method finder and enter the receiver, arguments and expected results, for example with:
34. 17. '20'
the method finder will display 2 matching methods, 34 printStringBase: 17 --> '20'
and 34 radix: 17 --> '20'