Browse Source

Expand the WrappingNeg examples a little

Josh Stone 5 years ago
parent
commit
e1ecc9da48
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/ops/wrapping.rs

+ 2 - 1
src/ops/wrapping.rs

@@ -116,7 +116,8 @@ pub trait WrappingNeg: Sized {
     /// use num_traits::WrappingNeg;
     ///
     /// assert_eq!(100i8.wrapping_neg(), -100);
-    /// assert_eq!((-128i8).wrapping_neg(), -128);
+    /// assert_eq!((-100i8).wrapping_neg(), 100);
+    /// assert_eq!((-128i8).wrapping_neg(), -128); // wrapped!
     /// ```
     fn wrapping_neg(&self) -> Self;
 }