From 68d1c23cfa85c45ef62fd47cfc5f7e2739925b9e Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 28 Aug 2024 12:17:25 -0700 Subject: [PATCH] allow simple ops (why did this not work before?) --- fixed_wide/src/fixed.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/fixed_wide/src/fixed.rs b/fixed_wide/src/fixed.rs index 52284d9..47ae1a9 100644 --- a/fixed_wide/src/fixed.rs +++ b/fixed_wide/src/fixed.rs @@ -68,6 +68,19 @@ macro_rules! impl_operator { } } } + impl core::ops::$trait for $struct + where + BInt:::From, + { + type Output = $output; + + fn $method(self, other: U) -> Self::Output { + Self { + bits:self.bits.$method(BInt::::from(other)< core::ops::$trait for $struct + where + BInt:::From, + { + fn $method(&mut self, other: U) { + self.bits.$method(BInt::::from(other)<