On Tuesday, 25 November 2014 at 13:52:32 UTC, Kagamin wrote:
Overflow checking doesn't contradict to overflow being defined. The latter simply reflects how hardware works, nothing else. And hardware works that way, because that's a fast implementation of arithmetic for general case.

So you are basically saying that D does not provide modular arithmetic, but allows you to continue with the incorrect result of an overflow as a modulo representation?

Because you have to choose, you cannot both have modular arithmetic and overflow at the same time for the same operator. Overflow happens because you have monotonic semantics for addition, not modular semantics.

Btw, http://dlang.org/expression needs a clean up, the term "underflow" is not used correctly.

Reply via email to