Skip to content

Commit f74fdd2

Browse files
Add code example for wrapping_neg method for signed integers
1 parent 717f5df commit f74fdd2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/num/int_macros.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2101,6 +2101,7 @@ macro_rules! int_impl {
21012101
///
21022102
/// ```
21032103
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".wrapping_neg(), -100);")]
2104+
#[doc = concat!("assert_eq!(-100", stringify!($SelfT), ".wrapping_neg(), 100);")]
21042105
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.wrapping_neg(), ", stringify!($SelfT), "::MIN);")]
21052106
/// ```
21062107
#[stable(feature = "num_wrapping", since = "1.2.0")]

0 commit comments

Comments
 (0)