On Wednesday, 4 November 2015 at 04:22:03 UTC, BBasile wrote:
On Wednesday, 4 November 2015 at 03:55:13 UTC, Namal wrote:
Is there a way to detect overflow for example for:

        int i = 2_000_000_000;
        
        int a = i*i*i;
        
        writeln(a);

-> 1073741824

You can use core.checkedint [1]

---

http://dlang.org/phobos/core_checkedint.html

Is it just an error in the documentation that the return value is stated as sum for the multiplication functions?

Reply via email to