Struct dmntk_feel::FeelNumber

source ·
pub struct FeelNumber(/* private fields */);
Expand description

FEEL number.

Implementations§

source§

impl FeelNumber

source

pub fn infinite() -> FeelNumber

Returns FeelNumber value Inf (infinite).

source

pub fn zero() -> FeelNumber

Returns FeelNumber value 0 (zero).

source

pub fn one() -> FeelNumber

Returns FeelNumber value 1 (one).

source

pub fn two() -> FeelNumber

Returns FeelNumber value 2 (two).

source

pub fn billion() -> FeelNumber

Returns FeelNumber value 1000000000 (billion).

source

pub fn new(n: i64, s: i32) -> FeelNumber

Creates a new FeelNumber from integer value and a scale.

source

pub fn abs(&self) -> FeelNumber

Returns an absolute value of this FeelNumber.

source

pub fn ceiling(&self) -> FeelNumber

Returns a nearest integer greater than this FeelNumber.

source

pub fn even(&self) -> bool

source

pub fn exp(&self) -> Option<FeelNumber>

source

pub fn floor(&self) -> FeelNumber

source

pub fn frac(&self) -> FeelNumber

source

pub fn is_integer(&self) -> bool

source

pub fn is_zero(&self) -> bool

source

pub fn is_one(&self) -> bool

source

pub fn is_negative(&self) -> bool

source

pub fn is_positive(&self) -> bool

source

pub fn ln(&self) -> Option<FeelNumber>

source

pub fn odd(&self) -> bool

source

pub fn pow(&self, rhs: &FeelNumber) -> Option<FeelNumber>

source

pub fn round(&self, rhs: &FeelNumber) -> FeelNumber

source

pub fn sqrt(&self) -> Option<FeelNumber>

source

pub fn square(&self) -> Option<FeelNumber>

source

pub fn trunc(&self) -> FeelNumber

Trait Implementations§

source§

impl Add for FeelNumber

§

type Output = FeelNumber

The resulting type after applying the + operator.
source§

fn add(self, rhs: FeelNumber) -> <FeelNumber as Add>::Output

Performs the + operation. Read more
source§

impl AddAssign for FeelNumber

source§

fn add_assign(&mut self, rhs: FeelNumber)

Performs the += operation. Read more
source§

impl Clone for FeelNumber

source§

fn clone(&self) -> FeelNumber

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FeelNumber

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for FeelNumber

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Converts FeelNumber to human readable string.

source§

impl Div for FeelNumber

§

type Output = FeelNumber

The resulting type after applying the / operator.
source§

fn div(self, rhs: FeelNumber) -> <FeelNumber as Div>::Output

Performs the / operation. Read more
source§

impl DivAssign for FeelNumber

source§

fn div_assign(&mut self, rhs: FeelNumber)

Performs the /= operation. Read more
source§

impl From<i16> for FeelNumber

source§

fn from(value: i16) -> FeelNumber

Converts to this type from the input type.
source§

impl From<i32> for FeelNumber

source§

fn from(value: i32) -> FeelNumber

Converts to this type from the input type.
source§

impl From<i64> for FeelNumber

source§

fn from(value: i64) -> FeelNumber

Converts to this type from the input type.
source§

impl From<i8> for FeelNumber

source§

fn from(value: i8) -> FeelNumber

Converts to this type from the input type.
source§

impl From<isize> for FeelNumber

source§

fn from(value: isize) -> FeelNumber

Converts to this type from the input type.
source§

impl From<u16> for FeelNumber

source§

fn from(value: u16) -> FeelNumber

Converts to this type from the input type.
source§

impl From<u32> for FeelNumber

source§

fn from(value: u32) -> FeelNumber

Converts to this type from the input type.
source§

impl From<u64> for FeelNumber

source§

fn from(value: u64) -> FeelNumber

Converts to this type from the input type.
source§

impl From<u8> for FeelNumber

source§

fn from(value: u8) -> FeelNumber

Converts to this type from the input type.
source§

impl From<usize> for FeelNumber

source§

fn from(value: usize) -> FeelNumber

Converts to this type from the input type.
source§

impl FromStr for FeelNumber

§

type Err = DmntkError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<FeelNumber, <FeelNumber as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl Jsonify for FeelNumber

source§

fn jsonify(&self) -> String

Converts FeelNumber to JSON string.

source§

impl Mul for FeelNumber

§

type Output = FeelNumber

The resulting type after applying the * operator.
source§

fn mul(self, rhs: FeelNumber) -> <FeelNumber as Mul>::Output

Performs the * operation. Read more
source§

impl MulAssign for FeelNumber

source§

fn mul_assign(&mut self, rhs: FeelNumber)

Performs the *= operation. Read more
source§

impl Neg for FeelNumber

§

type Output = FeelNumber

The resulting type after applying the - operator.
source§

fn neg(self) -> <FeelNumber as Neg>::Output

Performs the unary - operation. Read more
source§

impl PartialEq<isize> for FeelNumber

source§

fn eq(&self, rhs: &isize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for FeelNumber

source§

fn eq(&self, rhs: &FeelNumber) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<isize> for FeelNumber

source§

fn partial_cmp(&self, rhs: &isize) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd for FeelNumber

source§

fn partial_cmp(&self, rhs: &FeelNumber) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &FeelNumber) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &FeelNumber) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, rhs: &FeelNumber) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, rhs: &FeelNumber) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Rem for FeelNumber

§

type Output = FeelNumber

The resulting type after applying the % operator.
source§

fn rem(self, rhs: FeelNumber) -> <FeelNumber as Rem>::Output

Performs the % operation. Read more
source§

impl RemAssign for FeelNumber

source§

fn rem_assign(&mut self, rhs: FeelNumber)

Performs the %= operation. Read more
source§

impl Sub for FeelNumber

§

type Output = FeelNumber

The resulting type after applying the - operator.
source§

fn sub(self, rhs: FeelNumber) -> <FeelNumber as Sub>::Output

Performs the - operation. Read more
source§

impl SubAssign for FeelNumber

source§

fn sub_assign(&mut self, rhs: FeelNumber)

Performs the -= operation. Read more
source§

impl Copy for FeelNumber

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,