37 ms·
> In this case, our conventional languages provide no way for a programmer to say "I care about overflow". GCC and clang have builtin operations that return wh
by jmgao 10y ago
> In this case, our conventional languages provide no way for a programmer to say "I care about overflow".
GCC and clang have builtin operations that return whether they overflowed (bool __builtin_add_overflow(T a, T b, T* out), etc.). Similarly, Rust has wrapping, checked and saturating versions of all of the operations as methods on the integer types.