diff --git a/fixed_wide/src/fixed.rs b/fixed_wide/src/fixed.rs index a54a2af..84667bc 100644 --- a/fixed_wide/src/fixed.rs +++ b/fixed_wide/src/fixed.rs @@ -63,6 +63,10 @@ impl Fixed<1,F>{ pub const fn raw(value:i64)->Self{ Self::from_bits(BInt::from_bits(bnum::BUint::from_digit(value as u64))) } + #[inline] + pub const fn to_raw(self)->i64{ + self.to_bits().to_bits().digits()[0] as i64 + } } impl From for Fixed