Enum silx_types::FpCategory
1.0.0 · source · pub enum FpCategory {
Nan,
Infinite,
Zero,
Subnormal,
Normal,
}
Expand description
A classification of floating point numbers.
This enum
is used as the return type for f32::classify
and f64::classify
. See
their documentation for more.
§Examples
use std::num::FpCategory;
let num = 12.4_f32;
let inf = f32::INFINITY;
let zero = 0f32;
let sub: f32 = 1.1754942e-38;
let nan = f32::NAN;
assert_eq!(num.classify(), FpCategory::Normal);
assert_eq!(inf.classify(), FpCategory::Infinite);
assert_eq!(zero.classify(), FpCategory::Zero);
assert_eq!(sub.classify(), FpCategory::Subnormal);
assert_eq!(nan.classify(), FpCategory::Nan);
Variants§
Nan
NaN (not a number): this value results from calculations like (-1.0).sqrt()
.
See the documentation for f32
for more information on the unusual properties
of NaN.
Infinite
Positive or negative infinity, which often results from dividing a nonzero number by zero.
Zero
Positive or negative zero.
See the documentation for f32
for more information on the signedness of zeroes.
Subnormal
“Subnormal” or “denormal” floating point representation (less precise, relative to
their magnitude, than Normal
).
Subnormal numbers are larger in magnitude than Zero
but smaller in magnitude than all
Normal
numbers.
Normal
A regular floating point number, not any of the exceptional categories.
The smallest positive normal numbers are f32::MIN_POSITIVE
and f64::MIN_POSITIVE
,
and the largest positive normal numbers are f32::MAX
and f64::MAX
. (Unlike signed
integers, floating point numbers are symmetric in their range, so negating any of these
constants will produce their negative counterpart.)
Trait Implementations§
source§impl Clone for FpCategory
impl Clone for FpCategory
source§fn clone(&self) -> FpCategory
fn clone(&self) -> FpCategory
source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FpCategory
impl Debug for FpCategory
source§impl HashedTypeDef for FpCategorywhere
(): HashedTypeDef,
impl HashedTypeDef for FpCategorywhere
(): HashedTypeDef,
source§impl PartialEq for FpCategory
impl PartialEq for FpCategory
impl Copy for FpCategory
impl Eq for FpCategory
impl StructuralPartialEq for FpCategory
Auto Trait Implementations§
impl RefUnwindSafe for FpCategory
impl Send for FpCategory
impl Sync for FpCategory
impl Unpin for FpCategory
impl UnwindSafe for FpCategory
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
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
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> HashedTypeMethods for T
impl<T> HashedTypeMethods for T
source§fn type_hash_native<REF>() -> u128where
Self: HashedTypeDef<REF>,
fn type_hash_native<REF>() -> u128where
Self: HashedTypeDef<REF>,
source§fn type_hash_le<REF>() -> u128where
Self: HashedTypeDef<REF>,
fn type_hash_le<REF>() -> u128where
Self: HashedTypeDef<REF>,
source§fn type_hash_be<REF>() -> u128where
Self: HashedTypeDef<REF>,
fn type_hash_be<REF>() -> u128where
Self: HashedTypeDef<REF>,
source§fn type_uuid<REF>() -> Uuidwhere
Self: HashedTypeDef<REF>,
fn type_uuid<REF>() -> Uuidwhere
Self: HashedTypeDef<REF>,
source§fn type_uuid_hyphenated<REF>() -> Stringwhere
Self: HashedTypeDef<REF>,
fn type_uuid_hyphenated<REF>() -> Stringwhere
Self: HashedTypeDef<REF>,
source§fn self_type_hash_native<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
fn self_type_hash_native<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
source§fn self_type_hash_le<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
fn self_type_hash_le<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
source§fn self_type_hash_be<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
fn self_type_hash_be<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
source§fn self_type_uuid<REF>(&self) -> Uuidwhere
Self: HashedTypeDef<REF>,
fn self_type_uuid<REF>(&self) -> Uuidwhere
Self: HashedTypeDef<REF>,
source§fn self_type_uuid_hyphenated<REF>(&self) -> Stringwhere
Self: HashedTypeDef<REF>,
fn self_type_uuid_hyphenated<REF>(&self) -> Stringwhere
Self: HashedTypeDef<REF>,
source§impl<T> HashedTypeUuid for T
impl<T> HashedTypeUuid for T
source§fn type_hash_native<REF>() -> u128where
Self: HashedTypeDef<REF>,
fn type_hash_native<REF>() -> u128where
Self: HashedTypeDef<REF>,
HashedTypeMethods
traitsource§fn type_hash_le<REF>() -> u128where
Self: HashedTypeDef<REF>,
fn type_hash_le<REF>() -> u128where
Self: HashedTypeDef<REF>,
HashedTypeMethods
traitsource§fn type_hash_be<REF>() -> u128where
Self: HashedTypeDef<REF>,
fn type_hash_be<REF>() -> u128where
Self: HashedTypeDef<REF>,
HashedTypeMethods
traitsource§fn type_uuid<REF>() -> Uuidwhere
Self: HashedTypeDef<REF>,
fn type_uuid<REF>() -> Uuidwhere
Self: HashedTypeDef<REF>,
HashedTypeMethods
traitsource§fn type_uuid_hyphenated<REF>() -> Stringwhere
Self: HashedTypeDef<REF>,
fn type_uuid_hyphenated<REF>() -> Stringwhere
Self: HashedTypeDef<REF>,
HashedTypeMethods
traitsource§fn self_type_hash_native<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
fn self_type_hash_native<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
HashedTypeMethods
traitsource§fn self_type_hash_le<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
fn self_type_hash_le<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
HashedTypeMethods
traitsource§fn self_type_hash_be<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
fn self_type_hash_be<REF>(&self) -> u128where
Self: HashedTypeDef<REF>,
HashedTypeMethods
traitsource§fn self_type_uuid<REF>(&self) -> Uuidwhere
Self: HashedTypeDef<REF>,
fn self_type_uuid<REF>(&self) -> Uuidwhere
Self: HashedTypeDef<REF>,
HashedTypeMethods
traitsource§fn self_type_uuid_hyphenated<REF>(&self) -> Stringwhere
Self: HashedTypeDef<REF>,
fn self_type_uuid_hyphenated<REF>(&self) -> Stringwhere
Self: HashedTypeDef<REF>,
HashedTypeMethods
traitsource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.