uint overflow behaviour

DLearner bmqazwsx123 at gmail.com
Wed Sep 15 10:08:13 UTC 2021


Please confirm that if the addition of two uint variables 
produces a result larger than can be held in a uint:
1.  This is a D-legal operation (however inadvisable!), with the 
D-defined result of wraparound;
2.  Emphasing 1. above: the result is not undefined, or an error 
(by the rules of D), or simply implementation-dependant (whether 
by compiler or chip).

Best regards



More information about the Digitalmars-d-learn mailing list