Implement Neg for Scalar

This commit is contained in:
Hanno Braun 2025-01-07 19:22:53 +01:00
parent cc3a852bbe
commit 828326441e

View File

@ -73,6 +73,15 @@ where
}
}
impl ops::Neg for Scalar {
type Output = Self;
fn neg(self) -> Self::Output {
let value = -self.value();
Self::new(value)
}
}
impl<S> ops::Sub<S> for Scalar
where
S: Into<Scalar>,