pub struct FixedPoint {
pub value: BigUint,
}Expand description
A fixed point number
Fields§
§value: BigUintThe value of the fixed point number
Implementations§
Source§impl FixedPoint
impl FixedPoint
Sourcepub fn floor_mul_int(&self, amount: Amount) -> Amount
pub fn floor_mul_int(&self, amount: Amount) -> Amount
Multiply a fixed point number by an Amount and return the floor
Sourcepub fn ceil_div_int(amount: Amount, fp: &Self) -> Amount
pub fn ceil_div_int(amount: Amount, fp: &Self) -> Amount
Divide an Amount by a fixed point number and return the ceiling
Trait Implementations§
Source§impl<'a> Add for &'a FixedPoint
impl<'a> Add for &'a FixedPoint
Source§impl Clone for FixedPoint
impl Clone for FixedPoint
Source§fn clone(&self) -> FixedPoint
fn clone(&self) -> FixedPoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FixedPoint
impl Debug for FixedPoint
Source§impl<'de> Deserialize<'de> for FixedPoint
impl<'de> Deserialize<'de> for FixedPoint
Source§fn deserialize<D>(deserializer: D) -> Result<FixedPoint, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<FixedPoint, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for FixedPoint
impl Display for FixedPoint
Auto Trait Implementations§
impl Freeze for FixedPoint
impl RefUnwindSafe for FixedPoint
impl Send for FixedPoint
impl Sync for FixedPoint
impl Unpin for FixedPoint
impl UnsafeUnpin for FixedPoint
impl UnwindSafe for FixedPoint
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more