Skip to content

Commit

Permalink
Add code example for wrapping_neg method for signed integers
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 21, 2024
1 parent 717f5df commit f74fdd2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,7 @@ macro_rules! int_impl {
///
/// ```
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".wrapping_neg(), -100);")]
#[doc = concat!("assert_eq!(-100", stringify!($SelfT), ".wrapping_neg(), 100);")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.wrapping_neg(), ", stringify!($SelfT), "::MIN);")]
/// ```
#[stable(feature = "num_wrapping", since = "1.2.0")]
Expand Down

0 comments on commit f74fdd2

Please sign in to comment.