mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 13:36:49 +00:00
Add code example for wrapping_neg
method for signed integers
This commit is contained in:
parent
717f5df2c3
commit
67bdc9b337
@ -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")]
|
||||
|
Loading…
Reference in New Issue
Block a user