1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//! Limb negation

use crate::{Limb, Wrapping};
use core::ops::Neg;

impl Neg for Wrapping<Limb> {
    type Output = Self;

    fn neg(self) -> Self::Output {
        Self(self.0.wrapping_neg())
    }
}

impl Limb {
    /// Perform wrapping negation.
    #[inline(always)]
    pub const fn wrapping_neg(self) -> Self {
        Limb(self.0.wrapping_neg())
    }
}