Struct injective_math::fp_decimal::FPDecimal
source · pub struct FPDecimal {
pub num: U256,
pub sign: i8,
}
Fields§
§num: U256
§sign: i8
Implementations§
source§impl FPDecimal
impl FPDecimal
pub fn _add(x: FPDecimal, y: FPDecimal) -> FPDecimal
pub fn add(&self, other: i128) -> FPDecimal
pub fn _sub(x: FPDecimal, y: FPDecimal) -> FPDecimal
pub fn sub(&self, other: i128) -> FPDecimal
pub fn _mul(x: FPDecimal, y: FPDecimal) -> FPDecimal
pub fn mul(&self, other: i128) -> FPDecimal
pub fn _div(x: FPDecimal, y: FPDecimal) -> FPDecimal
pub fn div(&self, other: i128) -> FPDecimal
pub fn reciprocal(x: FPDecimal) -> FPDecimal
pub fn abs(&self) -> FPDecimal
pub fn abs_diff(&self, other: &Self) -> Self
source§impl FPDecimal
impl FPDecimal
pub const MAX: FPDecimal = _
pub const MIN: FPDecimal = _
pub const DIGITS: usize = 18usize
pub const NEGATIVE_ONE: FPDecimal = _
pub const ZERO: FPDecimal = _
pub const ONE: FPDecimal = _
pub const TWO: FPDecimal = _
pub const THREE: FPDecimal = _
pub const FOUR: FPDecimal = _
pub const FIVE: FPDecimal = _
pub const SIX: FPDecimal = _
pub const SEVEN: FPDecimal = _
pub const EIGHT: FPDecimal = _
pub const NINE: FPDecimal = _
pub const MUL_PRECISION: FPDecimal = _
pub const E_10: FPDecimal = _
pub const E: FPDecimal = _
pub const LN_10: FPDecimal = _
pub const LN_1_5: FPDecimal = _
pub const PI: FPDecimal = _
pub const fn one() -> FPDecimal
pub const fn zero() -> FPDecimal
pub fn is_zero(&self) -> bool
pub fn is_negative(&self) -> bool
pub const fn max() -> FPDecimal
pub const fn min() -> FPDecimal
pub const fn e() -> FPDecimal
pub fn _int(x: FPDecimal) -> FPDecimal
pub fn int(&self) -> FPDecimal
pub fn is_int(&self) -> bool
pub fn _sign(x: FPDecimal) -> i8
pub fn _fraction(x: FPDecimal) -> FPDecimal
pub fn fraction(&self) -> FPDecimal
Trait Implementations§
source§impl AddAssign<FPDecimal> for FPDecimal
impl AddAssign<FPDecimal> for FPDecimal
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl<'de> Deserialize<'de> for FPDecimal
impl<'de> Deserialize<'de> for FPDecimal
Deserializes as a base64 string
source§fn deserialize<D>(deserializer: D) -> Result<FPDecimal, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<FPDecimal, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromStr for FPDecimal
impl FromStr for FPDecimal
source§impl JsonSchema for FPDecimal
impl JsonSchema for FPDecimal
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl MulAssign<FPDecimal> for FPDecimal
impl MulAssign<FPDecimal> for FPDecimal
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl Ord for FPDecimal
impl Ord for FPDecimal
source§impl PartialEq<FPDecimal> for FPDecimal
impl PartialEq<FPDecimal> for FPDecimal
source§impl PartialOrd<FPDecimal> for FPDecimal
impl PartialOrd<FPDecimal> for FPDecimal
source§impl SubAssign<FPDecimal> for FPDecimal
impl SubAssign<FPDecimal> for FPDecimal
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read more