generated from eigerco/beerus
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Add WrappingMath trait Please check the type of change your PR introduces: - [ ] Bugfix - [x] Feature - [ ] Code style update (formatting, renaming) - [ ] Refactoring (no functional changes, no API changes) - [ ] Build-related changes - [ ] Documentation content changes - [ ] Other (please describe): ## What is the current behavior? Individual functions for wrapping ops in uints. Issue Number: #214 ## What is the new behavior? Adds a `WrappingMath` trait on math and implements it for uints. It provides `wrapping_add`, `wrapping_sub` and `wrapping_mul`, removing the need to use type-specific wrapping operations like `u64_wrapping_add`. I added it directly to `math`, since I wasn't totally sure where would be the best module to keep this. Feel free to move / ask me to move it somewhere else. (edit: Also adds individual traits for each operation: `WrappingAdd`, `WrappingSub` and `WrappingMul`) ## Does this introduce a breaking change? - [ ] Yes - [x] No
- Loading branch information
Showing
2 changed files
with
349 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters