Enum lexical_core::RoundingKind [−][src]
#[repr(i32)] pub enum RoundingKind { NearestTieEven, NearestTieAwayZero, TowardPositiveInfinity, TowardNegativeInfinity, TowardZero, // some variants omitted }
Rounding type for float-parsing.
Defines the IEEE754 rounding scheme to be used during float parsing.
In general, this should be set to NearestTieEven
, the default
recommended rounding scheme by IEEE754 for binary and decimal
operations.
FFI
For interfacing with FFI-code, this may be approximated by:
const int32_t NEAREST_TIE_EVEN = 0;
const int32_t NEAREST_TIE_AWAY_ZERO = 1;
const int32_t TOWARD_POSITIVE_INFINITY = 2;
const int32_t TOWARD_NEGATIVE_INFINITY = 3;
const int32_t TOWARD_ZERO = 4;
Safety
Assigning any value outside the range [1-4]
to value of type
RoundingKind may invoke undefined-behavior.
Variants
Round to the nearest, tie to even.
Round to the nearest, tie away from zero.
Round toward positive infinity.
Round toward negative infinity.
Round toward zero.
Trait Implementations
impl Clone for RoundingKind
[src]
fn clone(&self) -> RoundingKind
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for RoundingKind
[src]
impl Debug for RoundingKind
[src]
impl Eq for RoundingKind
[src]
impl PartialEq<RoundingKind> for RoundingKind
[src]
fn eq(&self, other: &RoundingKind) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ne(&self, other: &Rhs) -> boolimpl StructuralEq for RoundingKind
[src]
impl StructuralPartialEq for RoundingKind
[src]
Auto Trait Implementations
impl RefUnwindSafe for RoundingKind
impl Send for RoundingKind
impl Sync for RoundingKind
impl Unpin for RoundingKind
impl UnwindSafe for RoundingKind
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,