pub struct EDs {
pub val: BigUint,
pub decimals: u8,
}Expand description
Fixed-point decimals with primitive math (+-*/) implemented correctly
Fields§
§val: BigUint§decimals: u8Implementations§
source§impl EDs
impl EDs
pub fn new(val: BigUint, decimals: u8) -> Self
pub fn base(decimals: u8) -> &'static BigUint
pub fn zero(decimals: u8) -> Self
pub fn one(decimals: u8) -> Self
pub fn f0_1(decimals: u8) -> Self
pub fn f0_2(decimals: u8) -> Self
pub fn f0_25(decimals: u8) -> Self
pub fn f0_3(decimals: u8) -> Self
pub fn f0_33(decimals: u8) -> Self
pub fn f0_4(decimals: u8) -> Self
pub fn f0_5(decimals: u8) -> Self
pub fn f0_6(decimals: u8) -> Self
pub fn f0_67(decimals: u8) -> Self
pub fn f0_7(decimals: u8) -> Self
pub fn f0_75(decimals: u8) -> Self
pub fn f0_8(decimals: u8) -> Self
pub fn f0_9(decimals: u8) -> Self
pub fn two(decimals: u8) -> Self
pub fn sqrt(&self) -> Self
pub fn to_const<const D: usize>(self) -> ECs<D>
pub fn to_decimals(self, new_decimals: u8) -> EDs
Trait Implementations§
source§impl AddAssign<&EDs> for EDs
impl AddAssign<&EDs> for EDs
source§fn add_assign(&mut self, rhs: &EDs)
fn add_assign(&mut self, rhs: &EDs)
Performs the
+= operation. Read moresource§impl AddAssign for EDs
impl AddAssign for EDs
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moresource§impl CandidType for EDs
impl CandidType for EDs
source§impl<'de> Deserialize<'de> for EDs
impl<'de> Deserialize<'de> for EDs
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl DivAssign<&EDs> for EDs
impl DivAssign<&EDs> for EDs
source§fn div_assign(&mut self, rhs: &EDs)
fn div_assign(&mut self, rhs: &EDs)
Performs the
/= operation. Read moresource§impl DivAssign<u64> for EDs
impl DivAssign<u64> for EDs
source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
Performs the
/= operation. Read moresource§impl DivAssign for EDs
impl DivAssign for EDs
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moresource§impl MulAssign<&EDs> for EDs
impl MulAssign<&EDs> for EDs
source§fn mul_assign(&mut self, rhs: &EDs)
fn mul_assign(&mut self, rhs: &EDs)
Performs the
*= operation. Read moresource§impl MulAssign<u64> for EDs
impl MulAssign<u64> for EDs
source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
Performs the
*= operation. Read moresource§impl MulAssign for EDs
impl MulAssign for EDs
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moresource§impl Ord for EDs
impl Ord for EDs
source§impl PartialOrd for EDs
impl PartialOrd for EDs
source§impl SubAssign<&EDs> for EDs
impl SubAssign<&EDs> for EDs
source§fn sub_assign(&mut self, rhs: &EDs)
fn sub_assign(&mut self, rhs: &EDs)
Performs the
-= operation. Read moresource§impl SubAssign for EDs
impl SubAssign for EDs
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Eq for EDs
impl StructuralPartialEq for EDs
Auto Trait Implementations§
impl Freeze for EDs
impl RefUnwindSafe for EDs
impl Send for EDs
impl Sync for EDs
impl Unpin for EDs
impl UnwindSafe for EDs
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)