On Wednesday, 16 July 2014 at 21:26:41 UTC, Gary Willoughby wrote:
This was asked a few years ago and i could find a definitive answer.

http://forum.dlang.org/thread/[email protected]

On Saturday, 5 May 2012 at 04:57:48 UTC, Alex Rønne Petersen wrote:
I don't think the language really makes it clear whether overflows and underflows are well-defined. Do we guarantee that for any integral type T, T.max + 1 == T.min and T.min - 1 == T.max?

What is the current situation of integer overflow and underflow?

If you still feel ok today then dont read this:
-----------------
module meh;

import std.stdio;

//https://stackoverflow.com/questions/24676375/why-does-int-i-1024-1024-1024-1024-compile-without-error

static shared immutable int o = 1024 * 1024 * 1024 * 1024;

void main(string args[])
{
    writeln(o);
}
-------------------------------------------------------------

Reply via email to