diff --git a/fixed_wide/src/fixed.rs b/fixed_wide/src/fixed.rs index 23a8774..b26a4ed 100644 --- a/fixed_wide/src/fixed.rs +++ b/fixed_wide/src/fixed.rs @@ -9,17 +9,17 @@ pub struct Fixed{ } impl Fixed{ - pub const MAX:Self=Self{bits:BInt::::MAX,frac:PhantomData}; - pub const MIN:Self=Self{bits:BInt::::MIN,frac:PhantomData}; - pub const ZERO:Self=Self{bits:BInt::::ZERO,frac:PhantomData}; - pub const EPSILON:Self=Self{bits:BInt::::ONE,frac:PhantomData}; - pub const NEG_EPSILON:Self=Self{bits:BInt::::NEG_ONE,frac:PhantomData}; - pub const ONE:Self=Self{bits:BInt::::ONE.shl(Frac::U32),frac:PhantomData}; - pub const TWO:Self=Self{bits:BInt::::TWO.shl(Frac::U32),frac:PhantomData}; - pub const HALF:Self=Self{bits:BInt::::ONE.shl(Frac::U32-1),frac:PhantomData}; - pub const NEG_ONE:Self=Self{bits:BInt::::NEG_ONE.shl(Frac::U32),frac:PhantomData}; - pub const NEG_TWO:Self=Self{bits:BInt::::NEG_TWO.shl(Frac::U32),frac:PhantomData}; - pub const NEG_HALF:Self=Self{bits:BInt::::NEG_ONE.shl(Frac::U32-1),frac:PhantomData}; + pub const MAX:Self=Self::from_bits(BInt::::MAX); + pub const MIN:Self=Self::from_bits(BInt::::MIN); + pub const ZERO:Self=Self::from_bits(BInt::::ZERO); + pub const EPSILON:Self=Self::from_bits(BInt::::ONE); + pub const NEG_EPSILON:Self=Self::from_bits(BInt::::NEG_ONE); + pub const ONE:Self=Self::from_bits(BInt::::ONE.shl(Frac::U32)); + pub const TWO:Self=Self::from_bits(BInt::::TWO.shl(Frac::U32)); + pub const HALF:Self=Self::from_bits(BInt::::ONE.shl(Frac::U32-1)); + pub const NEG_ONE:Self=Self::from_bits(BInt::::NEG_ONE.shl(Frac::U32)); + pub const NEG_TWO:Self=Self::from_bits(BInt::::NEG_TWO.shl(Frac::U32)); + pub const NEG_HALF:Self=Self::from_bits(BInt::::NEG_ONE.shl(Frac::U32-1)); pub const fn from_bits(bits:BInt::)->Self{ Self{ bits,