Fix overflow bug when creating the absolute value
Previously, the tests failed on some platforms due to it.
This commit is contained in:
parent
6eeab2e62f
commit
915c2fd0d3
1 changed files with 1 additions and 1 deletions
|
|
@ -63,7 +63,7 @@ macro_rules! int_impl {
|
|||
|
||||
fn extract_sign(self) -> (bool, $uty) {
|
||||
if self < 0 {
|
||||
(true, !(self as $uty) + 1)
|
||||
(true, (!(self as $uty)).wrapping_add(1))
|
||||
} else {
|
||||
(false, self as $uty)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue