diff --git a/fixed_wide/src/fixed.rs b/fixed_wide/src/fixed.rs index 14c8245..635b2e2 100644 --- a/fixed_wide/src/fixed.rs +++ b/fixed_wide/src/fixed.rs @@ -585,6 +585,9 @@ macro_rules! impl_fix_rhs_lt_lhs_not_const_generic{ paste::item!{ #[inline] pub fn [](self)->Fixed<$rhs,{$rhs*32}>{ + let max=bnum::cast::As::as_::>(BInt::<$rhs>::MAX).shl(($lhs-$rhs)*32); + let min=bnum::cast::As::as_::>(BInt::<$rhs>::MIN).shl(($lhs-$rhs)*32); + assert!(min>(self.bits.shr(($lhs-$rhs)*32))) } }