Euh, sure this works:
(Number readFrom: 'FF' base: 16) printStringBase: 2
Number class>>#readFrom:base:
Integer class>>#readFrom:base:
On 15 Feb 2013, at 00:26, "Torsten Bergmann" <
[hidden email]> wrote:
> Sven wrote:
>> So something like this should work:
>>
>> (Integer readFrom: 'FF' base: 16) printStringBase: 2
>
> Integer readFrom: 'FF' will not work since #readFrom: expects a string in decimal representation
> and 'FF' is hexadecimal. It also wont work for large numbers due to sending it to "Integer".
>
> Just use
>
> (Number readFrom: '16rFF') printStringBase: 2
>
> which works for large numbers
>
> (Number readFrom: '16rFFFFFFFFF') printStringBase: 2
>
>
> Bye
> Torsten
>
>