pub struct Float(/* private fields */);
Expand description
A floating point number that can safely convert between other number types using compile-time evaluation when possible.
Implementations§
source§impl Float
impl Float
sourcepub fn as_f32(&self) -> Result<f32, Error>
pub fn as_f32(&self) -> Result<f32, Error>
Returns this number as an f32, if it can be done without losing precision.
sourcepub fn as_integer(&self) -> Result<Integer, Error>
pub fn as_integer(&self) -> Result<Integer, Error>
Returns this number as an Integer
, if the stored value has no fractional part.
Trait Implementations§
source§impl PartialEq for Float
impl PartialEq for Float
impl Copy for Float
impl StructuralPartialEq for Float
Auto Trait Implementations§
impl Freeze for Float
impl RefUnwindSafe for Float
impl Send for Float
impl Sync for Float
impl Unpin for Float
impl UnwindSafe for Float
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