'int' is enough for 'length' to migrate code from x86 to x64
Ary Borenszweig via Digitalmars-d
digitalmars-d at puremagic.com
Fri Nov 21 09:38:26 PST 2014
On 11/21/14, 11:47 AM, ketmar via Digitalmars-d wrote:
> On Fri, 21 Nov 2014 11:17:06 -0300
> Ary Borenszweig via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
>
>> "This bug can manifest itself for arrays whose length (in elements) is
>> 2^30 or greater (roughly a billion elements)"
>>
>> How often does that happen in practice?
> once in almost ten years is too often, as for me. i think that the
> answer must be "never". either no bug, or the code is broken. and one
> of the worst code is the code that "works most of the time", but still
> broken.
>
You see, if you don't use a BigNum for everything than you will always
have hidden bugs, be it with int, uint or whatever. The thing is that
with int bugs are much less frequent than with uint. So I don't know why
you'd rather have uint than int...
More information about the Digitalmars-d
mailing list