From 8fcb4e5c6ccb66fef669376556084a7f82246c02 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 30 Oct 2023 16:40:56 -0700 Subject: [PATCH] as works here --- src/integer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/integer.rs b/src/integer.rs index 2c56016..45f7963 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -315,8 +315,8 @@ impl Angle32{ pub fn clamp(&self,theta_min:Self,theta_max:Self)->Self{ //((max-min as u32)/2 as i32)+min let midpoint=(( - u32::from_ne_bytes(theta_max.0.to_ne_bytes()) - .wrapping_sub(u32::from_ne_bytes(theta_min.0.to_ne_bytes())) + (theta_max.0 as u32) + .wrapping_sub(theta_min.0 as u32) /2 ) as i32)//(u32::MAX/2) as i32 ALWAYS works .wrapping_add(theta_min.0);