What ?

matovitch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Mar 30 15:38:08 PDT 2015


On Monday, 30 March 2015 at 22:34:55 UTC, Vladimir Panteleev 
wrote:
> On Monday, 30 March 2015 at 22:34:00 UTC, matovitch wrote:
>> Hi again again,
>>
>> ulong u = 1 << 63;
>>
>> Raise :
>>
>> Error: shift by 63 is outside the range 0..31
>>
>> This is a bug isn't it, the ulong are supposed to be on 64 
>> bits ? I guess it's time I go to bed.
>>
>> Have a nice night !
>
> ulong, yes, but 1 is of type int.
>
> Correct code:
>
> ulong u = 1L << 63;

Arf ! Safety. Danke !


More information about the Digitalmars-d-learn mailing list