From 3d203e2da9d975ee4e82f41e3278f6a407407f6b Mon Sep 17 00:00:00 2001 From: Quaternions <krakow20@gmail.com> Date: Sat, 8 Mar 2025 14:34:17 -0800 Subject: [PATCH] fixed_wide: add midpoint --- lib/fixed_wide/src/fixed.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/fixed_wide/src/fixed.rs b/lib/fixed_wide/src/fixed.rs index f627ee717..16f721dd6 100644 --- a/lib/fixed_wide/src/fixed.rs +++ b/lib/fixed_wide/src/fixed.rs @@ -64,6 +64,10 @@ impl<const N:usize,const F:usize> Fixed<N,F>{ pub const fn abs(self)->Self{ Self::from_bits(self.bits.abs()) } + #[inline] + pub const fn midpoint(self,other:Self)->Self{ + Self::from_bits(self.bits.midpoint(other.bits)) + } } impl<const F:usize> Fixed<1,F>{ /// My old code called this function everywhere so let's provide it