Hi i want implement the simple Neg
trait for a custom type like:
impl<T: Num + Copy> Neg for V3<T> {
type Output = Self;
fn neg(self) -> Self {
let a = self[0];
let b = self[1];
let c = self[2];
V3::new([-a, -b, -c])
}
}
But i got the unary operator Error, with Floats works fine
|
90 | V3::new([-a, -b, -c])
| ^^ cannot apply unary operator `-`
I don't know how to solve it