diff --git a/packages/std/src/math/int128.rs b/packages/std/src/math/int128.rs index e94db80043..347924de06 100644 --- a/packages/std/src/math/int128.rs +++ b/packages/std/src/math/int128.rs @@ -1100,6 +1100,8 @@ mod tests { let b = Int128::from(-42i32); assert_eq!(b.abs(), a); + + assert_eq!(Int128::zero().abs(), Int128::zero()); assert_eq!((Int128::MIN + Int128::one()).abs(), Int128::MAX); } diff --git a/packages/std/src/math/int256.rs b/packages/std/src/math/int256.rs index 312215930b..c8ee50b442 100644 --- a/packages/std/src/math/int256.rs +++ b/packages/std/src/math/int256.rs @@ -1183,6 +1183,8 @@ mod tests { let b = Int256::from(-42i32); assert_eq!(b.abs(), a); + + assert_eq!(Int256::zero().abs(), Int256::zero()); assert_eq!((Int256::MIN + Int256::one()).abs(), Int256::MAX); } diff --git a/packages/std/src/math/int512.rs b/packages/std/src/math/int512.rs index a7759f8fe6..f9accee297 100644 --- a/packages/std/src/math/int512.rs +++ b/packages/std/src/math/int512.rs @@ -1236,6 +1236,8 @@ mod tests { let b = Int512::from(-42i32); assert_eq!(b.abs(), a); + + assert_eq!(Int512::zero().abs(), Int512::zero()); assert_eq!((Int512::MIN + Int512::one()).abs(), Int512::MAX); } diff --git a/packages/std/src/math/int64.rs b/packages/std/src/math/int64.rs index f87f719e07..12151eda2d 100644 --- a/packages/std/src/math/int64.rs +++ b/packages/std/src/math/int64.rs @@ -1043,6 +1043,8 @@ mod tests { let b = Int64::from(-42i32); assert_eq!(b.abs(), a); + + assert_eq!(Int64::zero().abs(), Int64::zero()); assert_eq!((Int64::MIN + Int64::one()).abs(), Int64::MAX); }