Fixed<1,_>::to_raw()

This commit is contained in:
Quaternions 2024-09-16 15:48:52 -07:00
parent 655a6da251
commit 6dbe96fca2

View File

@ -63,6 +63,10 @@ impl<const F:usize> Fixed<1,F>{
pub const fn raw(value:i64)->Self{ pub const fn raw(value:i64)->Self{
Self::from_bits(BInt::from_bits(bnum::BUint::from_digit(value as u64))) 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<const N:usize,const F:usize,T> From<T> for Fixed<N,F> impl<const N:usize,const F:usize,T> From<T> for Fixed<N,F>