pub struct Float(/* private fields */);Implementations§
Source§impl Float
impl Float
pub const NEG_INFINITY: Self
pub const INFINITY: Self
pub const MIN: Self
pub const MAX: Self
pub const NAN: Self
pub fn new(f: f32) -> Self
Sourcepub fn is_infinite(&self) -> bool
pub fn is_infinite(&self) -> bool
Returns true if this value is positive infinity or negative infinity, and false otherwise.
Sourcepub fn is_positive(&self) -> bool
pub fn is_positive(&self) -> bool
Returns true if self has a positive sign, including +0.0, NaNs with
positive sign bit and positive infinity.
Note that IEEE 754 doesn’t assign any meaning to the sign bit in case
of a NaN, and as Rust doesn’t guarantee that the bit pattern of NaNs
are conserved over arithmetic operations, the result of
is_positive on a NaN might produce an unexpected result in some
cases.
See explanation of NaN as a special value
for more info.
Sourcepub fn is_negative(&self) -> bool
pub fn is_negative(&self) -> bool
Returns false if self has a negative sign, including -0.0, NaNs with
negative sign bit and negative infinity.
Note that IEEE 754 doesn’t assign any meaning to the sign bit in case
of a NaN, and as Rust doesn’t guarantee that the bit pattern of NaNs
are conserved over arithmetic operations, the result of
is_negative on a NaN might produce an unexpected result in some
cases.
See explanation of NaN as a special value
for more info.
Trait Implementations§
Source§impl LexicalFormOf<Float> for Float
impl LexicalFormOf<Float> for Float
type ValueError = Infallible
fn try_as_value(&self) -> Result<Float, Self::ValueError>
fn as_value(&self) -> Vwhere
Self: LexicalFormOf<V, ValueError = Infallible>,
Source§impl Ord for Float
impl Ord for Float
Source§impl ParseXsd for Float
impl ParseXsd for Float
type LexicalForm = Float
fn parse_xsd(lexical_value: &str) -> ParseXsdResult<Self, Self::LexicalForm>
Source§impl PartialOrd for Float
impl PartialOrd for Float
impl Copy for Float
impl Eq 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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)