From 6dbe96fca2a028da8189e6f913ac7f81e7017818 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 16 Sep 2024 15:48:52 -0700 Subject: [PATCH] Fixed<1,_>::to_raw() --- fixed_wide/src/fixed.rs | 4 ++++ 1 file changed, 4 insertions(+) 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