Enum kalk::kalk_value::KalkValue
source · pub enum KalkValue {
Number(Float, Float, Option<String>),
Boolean(bool),
Vector(Vec<KalkValue>),
Matrix(Vec<Vec<KalkValue>>),
}
Variants§
Number(Float, Float, Option<String>)
Boolean(bool)
Vector(Vec<KalkValue>)
Matrix(Vec<Vec<KalkValue>>)
Implementations§
source§impl KalkValue
impl KalkValue
pub fn nan() -> Self
pub fn get_type_name(&self) -> String
pub fn to_string_big(&self) -> String
pub fn to_string_real(&self, radix: u8) -> String
pub fn to_string_imaginary(&self, radix: u8, include_i: bool) -> String
pub fn to_string_pretty_radix(&self, radix: u8) -> String
pub fn to_string_pretty(&self) -> String
pub fn to_string_with_unit(&self) -> String
sourcepub fn estimate(&self) -> Option<String>
pub fn estimate(&self) -> Option<String>
Get an estimate of what the number is, eg. 3.141592 => π. Does not work properly with scientific notation.
sourcepub fn round(&self) -> Option<KalkValue>
pub fn round(&self) -> Option<KalkValue>
Basic up/down rounding from 0.00xxx or 0.999xxx or xx.000xxx, etc.
pub fn round_if_needed(self) -> KalkValue
pub fn has_real(&self) -> bool
pub fn has_imaginary(&self) -> bool
pub fn is_nan(&self) -> bool
pub fn to_scientific_notation(
&self,
complex_number_type: ComplexNumberType
) -> ScientificNotation
pub fn has_unit(&self) -> bool
pub fn get_unit(&self) -> Option<&String>
pub fn get_conjugate(&self) -> Result<KalkValue, KalkError>
Trait Implementations§
source§impl PartialEq<KalkValue> for KalkValue
impl PartialEq<KalkValue> for KalkValue
impl StructuralPartialEq for KalkValue
Auto Trait Implementations§
impl RefUnwindSafe for KalkValue
impl Send for KalkValue
impl Sync for KalkValue
impl Unpin for KalkValue
impl UnwindSafe for KalkValue
Blanket Implementations§
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.