From cd1aa26293770df0a8d00a56022abf7efbe8bfa7 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 29 Aug 2024 17:22:45 -0700 Subject: [PATCH] prevent 50 headaches --- fixed_wide/src/fixed.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fixed_wide/src/fixed.rs b/fixed_wide/src/fixed.rs index b6956b2..23a8774 100644 --- a/fixed_wide/src/fixed.rs +++ b/fixed_wide/src/fixed.rs @@ -29,6 +29,9 @@ impl Fixed{ pub const fn to_bits(self)->BInt{ self.bits } + pub const fn raw(value:i64)->Self{ + Self::from_bits(BInt::from_bits(bnum::BUint::from_digit(value as u64))) + } } impl From for Fixed