Integer overflow and underflow semantics?

Basile Burg via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 21 18:36:40 PDT 2014


On Monday, 21 July 2014 at 14:32:38 UTC, bearophile wrote:
> Basile Burg:
>
>> 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);
>> }
>> -------------------------------------------------------------
>
> See:
> https://issues.dlang.org/show_bug.cgi?id=4835
> https://github.com/D-Programming-Language/dmd/pull/1803
>
> Bye,
> bearophile

oOPS...I've just missed an oportunity to shut up my 
mouth...However, I'm glad to see that someone else noticed that 
the real issue is that it's a <<const>>.


More information about the Digitalmars-d mailing list