[rust-dev] Integer overflow, round -2147483648
bascule at gmail.com
Wed Jun 18 11:15:31 PDT 2014
On Wed, Jun 18, 2014 at 10:08 AM, Gábor Lehel <glaebhoerl at gmail.com> wrote:
> # Between a rock and a hard place
> Having dispatched the "easy" cases above, for category #3 we're left
> between the rock (wraparound on overflow is wrong) and the hard place
> (checking for overflow is slow).
> Even here, we may have options.
I really like what Swift did: define two sets of operators, a default one
which checks/errors on overflow, and a second set of "overflow operators"
(which look like &+ &- etc) when you need the performance of unchecked
operations or otherwise desire overflow behavior:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rust-dev