Is there a formula for overflow?

Ali Çehreli acehreli at yahoo.com
Wed Nov 30 12:42:30 UTC 2022


On 11/29/22 19:07, thebluepandabear wrote:

 > But the book doesn't talk about why the D compiler came up with these
 > results

The compiler doesn't do anything special. It's all about the lack of 
bits to store the value. If the result needs 33 bits but the type has 
only 32 bits, the contribution of the highest bit is simply lost.

Ali



More information about the Digitalmars-d-learn mailing list