2 ms·
> What is Rust's policy for signed/unsigned int overflow? Defined, by default checked in debug mode and unchecked in release, unsigned wraps and signed wraps a
by masklinn 6y ago
> What is Rust's policy for signed/unsigned int overflow?
Defined, by default checked in debug mode and unchecked in release, unsigned wraps and signed wraps as two's complement. This can be overridden by explicitly setting overflow-checks in the relevant profile.
It also, separately, has explicitly wrapping, saturating and checking versions of basic arithmetic operations.