Struct kalk::kalk_num::with_rug::KalkNum[][src]

pub struct KalkNum { /* fields omitted */ }

Implementations

impl KalkNum[src]

pub fn new(value: Float, unit: &str) -> Self[src]

pub fn to_f64(&self) -> f64[src]

pub fn to_string(&self) -> String[src]

pub fn to_string_big(&self) -> String[src]

pub fn is_too_big(&self) -> bool[src]

pub fn to_string_with_unit(&self) -> String[src]

pub fn get_unit(&self) -> &str[src]

pub fn has_unit(&self) -> bool[src]

pub fn to_scientific_notation(&self) -> ScientificNotation[src]

pub fn convert_to_unit(
    &self,
    context: &mut Context<'_>,
    to_unit: &str
) -> Option<KalkNum>
[src]

pub fn add(self, context: &mut Context<'_>, rhs: KalkNum) -> KalkNum[src]

pub fn sub(self, context: &mut Context<'_>, rhs: KalkNum) -> KalkNum[src]

pub fn mul(self, context: &mut Context<'_>, rhs: KalkNum) -> KalkNum[src]

pub fn div(self, context: &mut Context<'_>, rhs: KalkNum) -> KalkNum[src]

pub fn rem(self, context: &mut Context<'_>, rhs: KalkNum) -> KalkNum[src]

pub fn pow(self, context: &mut Context<'_>, rhs: KalkNum) -> KalkNum[src]

impl KalkNum[src]

pub fn estimate(&self) -> Option<String>[src]

pub fn round(&self) -> Option<KalkNum>[src]

Basic up/down rounding from 0.00xxx or 0.999xxx or xx.000xxx, etc.

pub fn round_if_needed(&self) -> KalkNum[src]

Trait Implementations

impl Clone for KalkNum[src]

fn clone(&self) -> KalkNum[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for KalkNum[src]

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

Formats the value using the given formatter. Read more

impl Default for KalkNum[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl From<f32> for KalkNum[src]

fn from(x: f32) -> Self[src]

Performs the conversion.

impl From<f64> for KalkNum[src]

fn from(x: f64) -> Self[src]

Performs the conversion.

impl From<i128> for KalkNum[src]

fn from(x: i128) -> Self[src]

Performs the conversion.

impl From<i32> for KalkNum[src]

fn from(x: i32) -> Self[src]

Performs the conversion.

impl From<i64> for KalkNum[src]

fn from(x: i64) -> Self[src]

Performs the conversion.

impl Into<String> for KalkNum[src]

fn into(self) -> String[src]

Performs the conversion.

impl Into<f64> for KalkNum[src]

fn into(self) -> f64[src]

Performs the conversion.

impl PartialEq<KalkNum> for KalkNum[src]

fn eq(&self, other: &KalkNum) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &KalkNum) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for KalkNum[src]

Auto Trait Implementations

impl RefUnwindSafe for KalkNum

impl Send for KalkNum

impl Sync for KalkNum

impl Unpin for KalkNum

impl UnwindSafe for KalkNum

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Az for T[src]

pub fn az<Dst>(self) -> Dst where
    T: Cast<Dst>, 
[src]

Casts the value.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> CheckedAs for T[src]

pub fn checked_as<Dst>(self) -> Option<Dst> where
    T: CheckedCast<Dst>, 
[src]

Casts the value.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> OverflowingAs for T[src]

pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
    T: OverflowingCast<Dst>, 
[src]

Casts the value.

impl<T> SaturatingAs for T[src]

pub fn saturating_as<Dst>(self) -> Dst where
    T: SaturatingCast<Dst>, 
[src]

Casts the value.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> UnwrappedAs for T[src]

pub fn unwrapped_as<Dst>(self) -> Dst where
    T: UnwrappedCast<Dst>, 
[src]

Casts the value.

impl<T> WrappingAs for T[src]

pub fn wrapping_as<Dst>(self) -> Dst where
    T: WrappingCast<Dst>, 
[src]

Casts the value.