Struct dashu_float::round::mode::HalfEven
source · pub struct HalfEven;
Expand description
Round to the nearest value, ties are rounded to an even value. (default mode for decimal float)
Trait Implementations§
source§impl ErrorBounds for HalfEven
impl ErrorBounds for HalfEven
source§fn error_bounds<const B: Word>(
f: &FBig<Self, B>
) -> (FBig<Self, B>, FBig<Self, B>, bool, bool)
fn error_bounds<const B: Word>( f: &FBig<Self, B> ) -> (FBig<Self, B>, FBig<Self, B>, bool, bool)
Given a floating point number
f
, the output (L, R, incl_L, incl_R) represents the relative
error range with left bound f - L
and right bound f + R
. The two boolean values incl_L
and incl_R
represents whether the bounds f - L
and f + R
are inclusive respectively. Read moresource§impl Round for HalfEven
impl Round for HalfEven
source§fn round_low_part<F: FnOnce() -> Ordering>(
integer: &IBig,
low_sign: Sign,
low_half_test: F
) -> Rounding
fn round_low_part<F: FnOnce() -> Ordering>( integer: &IBig, low_sign: Sign, low_half_test: F ) -> Rounding
Calculate the rounding of the number (integer + rem), assuming rem != 0 and |rem| < 1.
low_half_test
should tell |rem|.cmp(0.5)impl Copy for HalfEven
Auto Trait Implementations§
impl RefUnwindSafe for HalfEven
impl Send for HalfEven
impl Sync for HalfEven
impl Unpin for HalfEven
impl UnwindSafe for HalfEven
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self
to an expression for Diesel’s query builder. Read moresource§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read more