On Tuesday, 6 October 2015 at 15:16:13 UTC, tcak wrote:
While writing max ulong value, I added the "u" postfix. So
compiler accepted it as ulong value (That's my interpretation
if correct on compiler's side).
writeln( 18_446_744_073_709_551_615u );
But when I try to print out minimum value
Jonathan,
I saw this answered in another post:
http://forum.dlang.org/post/gtaublmskqrhnbhoe...@forum.dlang.org
I.e., you can do long(-9223372036854775808UL) :)
Or long l = -9223372036854775808UL;
On Tuesday 06 October 2015 17:39, Ali Çehreli wrote:
> I would expect the following to work:
>
> writeln( -9_223_372_036_854_775_808L);
>
> But it doesn't compile:
>
>Error: signed integer overflow
>
> It looks like a compiler bug to me. If so, a very embarrassing one. :)
While writing max ulong value, I added the "u" postfix. So
compiler accepted it as ulong value (That's my interpretation if
correct on compiler's side).
writeln( 18_446_744_073_709_551_615u );
But when I try to print out minimum value of long, compiler says
Error: signed integer overflow
On Tuesday, October 06, 2015 15:16:12 tcak via Digitalmars-d-learn wrote:
> While writing max ulong value, I added the "u" postfix. So
> compiler accepted it as ulong value (That's my interpretation if
> correct on compiler's side).
>
> writeln( 18_446_744_073_709_551_615u );
>
> But when I try to
On 10/06/2015 08:16 AM, tcak wrote:
> While writing max ulong value, I added the "u" postfix.
Better to use U to be consistent with L (see below).
> But when I try to print out minimum value of long, compiler says
> Error: signed integer overflow
>
> writeln( -9_223_372_036_854_775_808 );
I