pub struct ArbitraryFloat { /* private fields */ }Expand description
Arbitrary precision floating-point number backed by oxinum_float::DBig (Pure Rust).
DBig is a base-10 decimal big-float. The ArbitraryPrecisionContext stores
precision in bits (for API stability), but all oxinum calls receive the
equivalent decimal-digit count.
Implementations§
Source§impl ArbitraryFloat
impl ArbitraryFloat
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new zero-valued arbitrary precision float with the default precision.
Sourcepub fn withprecision(prec: u32) -> CoreResult<Self>
pub fn withprecision(prec: u32) -> CoreResult<Self>
Create with a specific bit precision.
Sourcepub fn with_context(context: ArbitraryPrecisionContext) -> Self
pub fn with_context(context: ArbitraryPrecisionContext) -> Self
Create with a specific precision context.
Sourcepub fn from_f64_withprecision(v: f64, prec: u32) -> CoreResult<Self>
pub fn from_f64_withprecision(v: f64, prec: u32) -> CoreResult<Self>
Create from f64 with a specific bit precision.
Sourcepub fn from_strprec(s: &str, prec: u32) -> CoreResult<Self>
pub fn from_strprec(s: &str, prec: u32) -> CoreResult<Self>
Parse a decimal string with a specific bit precision.
Sourcepub fn decimalprecision(&self) -> u32
pub fn decimalprecision(&self) -> u32
Get the precision in decimal digits.
Sourcepub fn setprecision(&self, prec: u32) -> CoreResult<Self>
pub fn setprecision(&self, prec: u32) -> CoreResult<Self>
Return a new value rebound to the given bit precision.
Sourcepub fn is_finite(&self) -> bool
pub fn is_finite(&self) -> bool
Check if the value is finite (DBig is always finite — no NaN/infinity).
Sourcepub fn is_infinite(&self) -> bool
pub fn is_infinite(&self) -> bool
Check if the value is infinite (DBig has no infinity).
Sourcepub fn sqrt(&self) -> CoreResult<Self>
pub fn sqrt(&self) -> CoreResult<Self>
Square root.
Sourcepub fn ln(&self) -> CoreResult<Self>
pub fn ln(&self) -> CoreResult<Self>
Natural logarithm.
Sourcepub fn asin(&self) -> CoreResult<Self>
pub fn asin(&self) -> CoreResult<Self>
Arcsine.
Sourcepub fn acos(&self) -> CoreResult<Self>
pub fn acos(&self) -> CoreResult<Self>
Arccosine.
Sourcepub fn prec_2(prec: u32) -> CoreResult<Self>
pub fn prec_2(prec: u32) -> CoreResult<Self>
Compute π to the given bit precision.
Sourcepub fn prec_3(prec: u32) -> CoreResult<Self>
pub fn prec_3(prec: u32) -> CoreResult<Self>
Compute e (Euler’s number) to the given bit precision.
Sourcepub fn prec_4(prec: u32) -> CoreResult<Self>
pub fn prec_4(prec: u32) -> CoreResult<Self>
Compute ln(2) to the given bit precision.
Trait Implementations§
Source§impl Add for ArbitraryFloat
impl Add for ArbitraryFloat
Source§impl Clone for ArbitraryFloat
impl Clone for ArbitraryFloat
Source§fn clone(&self) -> ArbitraryFloat
fn clone(&self) -> ArbitraryFloat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArbitraryFloat
impl Debug for ArbitraryFloat
Source§impl Default for ArbitraryFloat
impl Default for ArbitraryFloat
Source§impl Display for ArbitraryFloat
impl Display for ArbitraryFloat
Source§impl Div for ArbitraryFloat
impl Div for ArbitraryFloat
Source§impl Mul for ArbitraryFloat
impl Mul for ArbitraryFloat
Source§impl Neg for ArbitraryFloat
impl Neg for ArbitraryFloat
Source§impl PartialEq for ArbitraryFloat
impl PartialEq for ArbitraryFloat
Source§impl PartialOrd for ArbitraryFloat
impl PartialOrd for ArbitraryFloat
Auto Trait Implementations§
impl Freeze for ArbitraryFloat
impl RefUnwindSafe for ArbitraryFloat
impl Send for ArbitraryFloat
impl Sync for ArbitraryFloat
impl Unpin for ArbitraryFloat
impl UnsafeUnpin for ArbitraryFloat
impl UnwindSafe for ArbitraryFloat
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
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>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ClosedNeg for Twhere
T: Neg<Output = T>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
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>,
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)
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>,
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
impl<T> Scalar for T
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.