| Thread overview | |||||
|---|---|---|---|---|---|
|
July 09, 2015 "shift by 64 is outside the range 0..31" dmd x64 | ||||
|---|---|---|---|---|
| ||||
ulong vv = 1 << 60 ; "Error: shift by 60 is outside the range 0..31" ?? | ||||
July 09, 2015 Re: "shift by 64 is outside the range 0..31" dmd x64 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to sdv | On Thursday, 9 July 2015 at 09:57:16 UTC, sdv wrote: > > > ulong vv = 1 << 60 ; > > > "Error: shift by 60 is outside the range 0..31" ?? Try: ulong vv = 1UL << 60; Integer literals are of type `int` by default. The compiler does sometimes use type information in variable initializations, it could potentially do that in this case, too. If you want, you can file an enhancement request here: https://issues.dlang.org/ | |||
July 09, 2015 Re: "shift by 64 is outside the range 0..31" dmd x64 | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Marc Schütz | On Thursday, 9 July 2015 at 10:05:12 UTC, Marc Schütz wrote:
> On Thursday, 9 July 2015 at 09:57:16 UTC, sdv wrote:
>>
>>
>> ulong vv = 1 << 60 ;
>>
>>
>> "Error: shift by 60 is outside the range 0..31" ??
>
> Try:
>
> ulong vv = 1UL << 60;
>
> Integer literals are of type `int` by default.
>
> The compiler does sometimes use type information in variable initializations, it could potentially do that in this case, too. If you want, you can file an enhancement request here: https://issues.dlang.org/
Thank you very much !
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply