Bug? or do I something wrong

Daniel Kozak via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 30 06:07:54 PST 2015


import std.stdio;

void main() {

     auto x = 9223372036854775807L;
     auto x2 = 9223372036854775807L + 1;
     long x3 = -9223372036854775808U;
     //auto x4 = -9223372036854775808L; //Error: signed integer 
overflow

     writeln(x + 1); //-9223372036854775808
     writeln(x2);    //-9223372036854775808
     writeln(x3);    //-9223372036854775808
     //writeln(x4);
}


More information about the Digitalmars-d mailing list