News for hackers. Stuff that matters.
Re:Go 2, here we come by greenleafjacob on Thursday November 29, 2018 @09:59PM (#18566260)
> if this int or uint under or overflows, throw an exception

Overflow flags are supported on some architectures, so it would really just be a matter of checking that flag.

Re:Go 2, here we come by 4ad on Friday November 30, 2018 @06:43AM (#18568388)
Except in Go, types are defined using modular 2s complement. Overflow is not considered a problem, it's a feature that code depends on.
Re:Go 2, here we come by LukeShu on Friday November 30, 2018 @11:34AM (#18570267)
The spec says:

> For signed integers, the operations +, -, , /, and << may legally overflow and the resulting value exists and is deterministically defined by …*

It does not go on to define the overflow values; that gets to be implementation defined.

This is in contrast to unsigned integers, which the spec does precisely define overflow for.