'int' is enough for 'length' to migrate code from x86 to x64

Matthias Bentrup via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 21 01:01:49 PST 2014


On Friday, 21 November 2014 at 08:54:40 UTC, Daniel Murphy wrote:
> "Walter Bright"  wrote in message 
> news:m4mu0q$sc5$1 at digitalmars.com...
>
>> > Zero, on the other hand, is usually quite near the typical 
>> > array lengths and
>> > differences in lengths.
>>
>> That's true, that's why they are detected sooner, when it is 
>> less costly to fix them.
>
> It would be even less costly if they weren't possible.

C# has the checked and unchecked operators 
(http://msdn.microsoft.com/en-us/library/khy08726.aspx), which 
allow the programmer to specify if overflows should wrap of fail 
within an arithmetic expression. That could be a useful addition 
to D.

However, a language that doesn't have unsigned integers and 
modular arithmetic is IMHO not a system language, because that is 
how most hardware works internally.


More information about the Digitalmars-d mailing list