[OT] Walter about compilers

Thiez thiezz at gmail.com
Tue Jan 22 09:10:34 PST 2013


On Tuesday, 22 January 2013 at 16:31:20 UTC, Era Scarecrow wrote:
> I really wouldn't want to have to use BigInt for everything 
> that can't overflow and then check to make sure I can fit it in 
> my smaller variables afterwards along with the extra move. I 
> wouldn't want to use BigInts everywhere, and long's aren't 
> needed everywhere either.

Since D aims to emulate C in this aspect, overflow with uints is 
probably defined as a wrap-around (like C). In this case it seems 
to me the check for overflow would simply be '(a+b)<a', no need 
to cast to longs and BigInts and all that. Of course this may not 
apply to signed ints...


More information about the Digitalmars-d mailing list