Skip to content

Commit 30aa6db

Browse files
committedNov 22, 2024
Add code example for wrapping_neg method for signed integers
1 parent 3c558bf commit 30aa6db

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎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)
Please sign in to comment.