Type Definition common::Fixed

source ·
pub type Fixed = FixedPoint<FixedInner, U18>;
Expand description

Basic type representing assets quantity.

MAX = (2 ** (BITS_COUNT - 1) - 1) / 10 ** PRECISION = = (2 ** (128 - 1) - 1) / 1e18 = = 170_141_183_460_469_231_731.687_303_715_884_105_727 ~ ~ 1.7e20 ERROR_MAX = 0.5 / (10 ** PRECISION) = = 0.5 / 1e18 = = 5e-19

Trait Implementations§

source§

impl Add<FixedWrapper> for Fixed

§

type Output = FixedWrapper

The resulting type after applying the + operator.
source§

fn add(self, rhs: FixedWrapper) -> Self::Output

Performs the + operation. Read more
source§

impl Div<FixedWrapper> for Fixed

§

type Output = FixedWrapper

The resulting type after applying the / operator.
source§

fn div(self, rhs: FixedWrapper) -> Self::Output

Performs the / operation. Read more
source§

impl Mul<FixedWrapper> for Fixed

§

type Output = FixedWrapper

The resulting type after applying the * operator.
source§

fn mul(self, rhs: FixedWrapper) -> Self::Output

Performs the * operation. Read more
source§

impl<T> Mul<SwapAmount<T>> for Fixedwhere T: Copy + RoundingMul<Output = T> + Into<Fixed> + From<Fixed>,

§

type Output = SwapAmount<T>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SwapAmount<T>) -> Self::Output

Performs the * operation. Read more
source§

impl Sub<FixedWrapper> for Fixed

§

type Output = FixedWrapper

The resulting type after applying the - operator.
source§

fn sub(self, rhs: FixedWrapper) -> Self::Output

Performs the - operation. Read more