Trait enso_prelude::Neg 1.0.0[−][src]
Expand description
The unary negation operator -
.
Examples
An implementation of Neg
for Sign
, which allows the use of -
to
negate its value.
use std::ops::Neg; #[derive(Debug, PartialEq)] enum Sign { Negative, Zero, Positive, } impl Neg for Sign { type Output = Self; fn neg(self) -> Self::Output { match self { Sign::Negative => Sign::Positive, Sign::Zero => Sign::Zero, Sign::Positive => Sign::Negative, } } } // A negative positive is a negative. assert_eq!(-Sign::Positive, Sign::Negative); // A double negative is a positive. assert_eq!(-Sign::Negative, Sign::Positive); // Zero is its own negation. assert_eq!(-Sign::Zero, Sign::Zero);
Associated Types
Required methods
Implementations on Foreign Types
impl<T> Neg for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<T> Neg for DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]impl<T> Neg for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<T> Neg for Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]impl<T, R, C, S> Neg for Matrix<T, R, C, S> where
C: Dim,
T: Scalar + ClosedNeg,
R: Dim,
S: Storage<T, R, C>,
DefaultAllocator: Allocator<T, R, C>,
[src]
impl<T, R, C, S> Neg for Matrix<T, R, C, S> where
C: Dim,
T: Scalar + ClosedNeg,
R: Dim,
S: Storage<T, R, C>,
DefaultAllocator: Allocator<T, R, C>,
[src]impl<T, R, C> Neg for Unit<Matrix<T, R, C, <DefaultAllocator as Allocator<T, R, C>>::Buffer>> where
C: Dim,
T: Scalar + ClosedNeg,
R: Dim,
DefaultAllocator: Allocator<T, R, C>,
[src]
impl<T, R, C> Neg for Unit<Matrix<T, R, C, <DefaultAllocator as Allocator<T, R, C>>::Buffer>> where
C: Dim,
T: Scalar + ClosedNeg,
R: Dim,
DefaultAllocator: Allocator<T, R, C>,
[src]impl<T> Neg for Unit<DualQuaternion<T>> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<T> Neg for Unit<DualQuaternion<T>> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = Unit<DualQuaternion<T>>
pub fn neg(self) -> <Unit<DualQuaternion<T>> as Neg>::Output
[src]
impl<'a, T, R, C, S> Neg for &'a Matrix<T, R, C, S> where
C: Dim,
T: Scalar + ClosedNeg,
R: Dim,
S: Storage<T, R, C>,
DefaultAllocator: Allocator<T, R, C>,
[src]
impl<'a, T, R, C, S> Neg for &'a Matrix<T, R, C, S> where
C: Dim,
T: Scalar + ClosedNeg,
R: Dim,
S: Storage<T, R, C>,
DefaultAllocator: Allocator<T, R, C>,
[src]impl<'a, T> Neg for &'a DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, T> Neg for &'a DualQuaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]impl<'a, T> Neg for &'a Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, T> Neg for &'a Quaternion<T> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]impl<'a, T> Neg for &'a Unit<DualQuaternion<T>> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]
impl<'a, T> Neg for &'a Unit<DualQuaternion<T>> where
T: SimdRealField,
<T as SimdValue>::Element: SimdRealField,
[src]type Output = Unit<DualQuaternion<T>>
pub fn neg(self) -> <&'a Unit<DualQuaternion<T>> as Neg>::Output
[src]
impl<U> Neg for NInt<U> where
U: Unsigned + NonZero,
impl<U> Neg for NInt<U> where
U: Unsigned + NonZero,
-NInt = PInt
impl<U> Neg for PInt<U> where
U: Unsigned + NonZero,
impl<U> Neg for PInt<U> where
U: Unsigned + NonZero,
-PInt = NInt