Re:C++ proposal: There are 8 bits in a byte
by loup-vaillant on Friday October 18, 2024 @07:39AM
(#41878431)
I've heard that Rust wraps around by default?
[ Parent
| on HN ]
Re:C++ proposal: There are 8 bits in a byte
by Measter on Friday October 18, 2024 @08:05AM
(#41878612)
Rust has two possible behaviours: panic or wrap. By default debug builds with panic, release builds with wrap. Both behaviours are 100% defined, so the compiler can't do any shenanigans.
There are also helper functions and types for unchecked/checked/wrapping/saturating arithmetic.