From 20a317612ed8c80eb315bcfd3579bcfc2f13e99d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 27 Aug 2024 16:49:49 -0700 Subject: [PATCH] fixed: constants --- fixed_wide/src/fixed.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fixed_wide/src/fixed.rs b/fixed_wide/src/fixed.rs index 5f72a47..ab18621 100644 --- a/fixed_wide/src/fixed.rs +++ b/fixed_wide/src/fixed.rs @@ -8,6 +8,12 @@ pub struct Fixed{ pub(crate)frac:PhantomData, } +impl Fixed{ + pub const ZERO:Self=Self{bits:BInt::::ZERO,frac:PhantomData}; + pub const ONE:Self=Self{bits:BInt::::ONE.shl(Frac::U32),frac:PhantomData}; + pub const NEG_ONE:Self=Self{bits:BInt::::NEG_ONE.shl(Frac::U32),frac:PhantomData}; +} + impl From for Fixed where BInt:From