pub enum CatFloat {
IntegerLike(f64),
FractionLike(f64),
IntegerAndFractionalPart(f64, f64),
Nan,
Infinity,
}Variants§
IntegerLike(f64)
For f64s like 1.0, -100.0, with no fractional part.
Being integer-like means this can usually be casted as an integer without issue.
Note: f64::MAX > u128::MAX
FractionLike(f64)
For f64s like 0.5 or -0.002, where there’s no integer part.
Casting this as an integer wouldn’t be recommended, since you’d lose information.
IntegerAndFractionalPart(f64, f64)
The Integer and Fractional parts of an f64, in that order.
Nan
The Float was NaN
Infinity
The Float was Infinity
Implementations§
Source§impl CatFloat
impl CatFloat
Sourcepub fn is_integer_like(&self) -> bool
pub fn is_integer_like(&self) -> bool
Returns true if the Classified float is IntegerLike.
Sourcepub fn is_fraction_like(&self) -> bool
pub fn is_fraction_like(&self) -> bool
Returns true if the Classified float is FractionLike.
Sourcepub fn is_integer_and_fractional_part(&self) -> bool
pub fn is_integer_and_fractional_part(&self) -> bool
Returns true if the Classified float is IntegerAndFractionalPart.
Sourcepub fn is_infinity(&self) -> bool
pub fn is_infinity(&self) -> bool
Returns true if the Classified float is Infinity.
Trait Implementations§
impl Copy for CatFloat
impl StructuralPartialEq for CatFloat
Auto Trait Implementations§
impl Freeze for CatFloat
impl RefUnwindSafe for CatFloat
impl Send for CatFloat
impl Sync for CatFloat
impl Unpin for CatFloat
impl UnwindSafe for CatFloat
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