3 ms·
> Is this a hack that should not be allowed? Yep. This is a hack that should not be allowed. If yo want to use it, you should create your own type, with expli
by marcosdumay 9y ago
> Is this a hack that should not be allowed?
Yep. This is a hack that should not be allowed.
If yo want to use it, you should create your own type, with explicit modular arithmetic. Not try to ride architectural dependent assumptions.
- myrrlyn 9y agoFwiw, Rust provides checked_op, saturating_op, and wrapping_op versions of arithmetic, as well as a Wrapping … wrapper https://doc.rust-lang.org/std/num/struct.Wrapping.html https://doc.rust-lang.org/std/num/struct.Wrapping.html