impl f64 ops for Measurement

master
elfeiin 2024-04-27 21:50:31 -07:00
parent e24cc2ca87
commit 5d258ca333
Signed by: elfein
GPG Key ID: A53FDD4FD091A276
1 changed files with 36 additions and 0 deletions

View File

@ -121,6 +121,24 @@ where
}
}
impl<
const TIME: i8,
const LENGTH: i8,
const MASS: i8,
const CURRENT: i8,
const TEMPERATURE: i8,
const AMOUNT: i8,
const INTENSITY: i8,
> Mul<f64> for Measurement<TIME, LENGTH, MASS, CURRENT, TEMPERATURE, AMOUNT, INTENSITY>
where
Self: Sized {
type Output = Self;
fn mul(self, rhs: f64) -> Self::Output {
Self(self.0 * rhs)
}
}
impl<
const A_TIME: i8,
const A_LENGTH: i8,
@ -193,6 +211,24 @@ where
}
}
impl<
const TIME: i8,
const LENGTH: i8,
const MASS: i8,
const CURRENT: i8,
const TEMPERATURE: i8,
const AMOUNT: i8,
const INTENSITY: i8,
> Div<f64> for Measurement<TIME, LENGTH, MASS, CURRENT, TEMPERATURE, AMOUNT, INTENSITY>
where
Self: Sized {
type Output = Self;
fn div(self, rhs: f64) -> Self::Output {
Self(self.0 / rhs)
}
}
impl<
const TIME: i8,
const LENGTH: i8,