On Wednesday, 15 September 2021 at 10:08:13 UTC, DLearner wrote:
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;

Definition under point 7 here : https://dlang.org/spec/expression.html#add_expressions

And I wouldn’t say inadvisable. It’s defined and if you have a good reason to allow that, then you can do that.

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).

Yes

-Steve


Reply via email to