OT: int.min

Timon Gehr timon.gehr at gmx.ch
Mon Feb 5 23:28:58 UTC 2018


On 05.02.2018 22:20, Nick Sabalausky wrote:
> Ouch. I guess "the real WTF" is that 2's complement leads to supporting 
> one value that cannot be negated. ...

Actually, it's not fully supported at this time, but it soon will be.

import std.exception;

void main(){
     auto i = int.min;
     enforce(i > 0); // pass :)
}

https://issues.dlang.org/show_bug.cgi?id=18315
https://github.com/dlang/dmd/pull/7841


More information about the Digitalmars-d mailing list