Thank you guys :)

I feel a little less dumb :) 
(even if it's not really natural for me to have this behaviour on string but ^^)

Ben

On Feb 15, 2013, at 12:33 AM, Sven Van Caekenberghe <s...@stfx.eu> wrote:

> 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" <asta...@gmx.de> 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
>> 
>> 
> 
> 

Reply via email to