inline const functions
This commit is contained in:
parent
0924518922
commit
78f860c672
@ -21,15 +21,18 @@ impl<const CHUNKS:usize,Frac:Unsigned> Fixed<CHUNKS,Frac>{
|
||||
pub const NEG_HALF:Self=Self::from_bits(BInt::<CHUNKS>::NEG_ONE.shl(Frac::U32-1));
|
||||
}
|
||||
impl<const CHUNKS:usize,Frac> Fixed<CHUNKS,Frac>{
|
||||
#[inline]
|
||||
pub const fn from_bits(bits:BInt::<CHUNKS>)->Self{
|
||||
Self{
|
||||
bits,
|
||||
frac:std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub const fn to_bits(self)->BInt<CHUNKS>{
|
||||
self.bits
|
||||
}
|
||||
#[inline]
|
||||
pub const fn raw(value:i64)->Self{
|
||||
Self::from_bits(BInt::from_bits(bnum::BUint::from_digit(value as u64)))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user