pub enum IntegerOrFloat {
Integer(i32),
Float(f32),
}Expand description
A generic container for an “integer or a float”.
Was made originally for the UFO data type “integer or float”.
Variants§
Integer(i32)
An integer: normally i32, but if compiled with x64-backing-store feature, can be an
f64.
Float(f32)
A float: normally f32, but if compiled with x64-backing-store feature, can be an
f64.
Implementations§
Source§impl IntegerOrFloat
impl IntegerOrFloat
Sourcepub fn holding_integer(&self) -> Result<i32, f32>
pub fn holding_integer(&self) -> Result<i32, f32>
If we’re holding an integer return it, else return in the Err variant our float.
Sourcepub fn holding_float(&self) -> Result<f32, i32>
pub fn holding_float(&self) -> Result<f32, i32>
If we’re holding a float return it, else return in the Err variant our integer.
Sourcepub fn unwrap_float(&self) -> f32
pub fn unwrap_float(&self) -> f32
Give back the float we’re holding…panic if we’re holding an integer.
Sourcepub fn unwrap_integer(&self) -> i32
pub fn unwrap_integer(&self) -> i32
Give back the integer we’re holding…panic if we’re holding a float.
Source§impl IntegerOrFloat
These functions should never be used when you’re holding the IntegerOrFloat::Integer variant.
impl IntegerOrFloat
These functions should never be used when you’re holding the IntegerOrFloat::Integer variant.
When [log::warn] is available, we warn you.
Sourcepub fn from_bits(bits: u32) -> IntegerOrFloat
pub fn from_bits(bits: u32) -> IntegerOrFloat
Cf. f_iof::from_bits
Sourcepub fn to_bits(&self) -> u32
pub fn to_bits(&self) -> u32
Cf. f_iof::to_bits
Trait Implementations§
Source§impl Add<f32> for IntegerOrFloat
impl Add<f32> for IntegerOrFloat
Source§impl Add<f64> for IntegerOrFloat
impl Add<f64> for IntegerOrFloat
Source§impl Add<i16> for IntegerOrFloat
impl Add<i16> for IntegerOrFloat
Source§impl Add<i32> for IntegerOrFloat
impl Add<i32> for IntegerOrFloat
Source§impl Add<i64> for IntegerOrFloat
impl Add<i64> for IntegerOrFloat
Source§impl Add<i8> for IntegerOrFloat
impl Add<i8> for IntegerOrFloat
Source§impl Add<isize> for IntegerOrFloat
impl Add<isize> for IntegerOrFloat
Source§impl Add<u16> for IntegerOrFloat
impl Add<u16> for IntegerOrFloat
Source§impl Add<u32> for IntegerOrFloat
impl Add<u32> for IntegerOrFloat
Source§impl Add<u64> for IntegerOrFloat
impl Add<u64> for IntegerOrFloat
Source§impl Add<u8> for IntegerOrFloat
impl Add<u8> for IntegerOrFloat
Source§impl Add<usize> for IntegerOrFloat
impl Add<usize> for IntegerOrFloat
Source§impl Add for IntegerOrFloat
impl Add for IntegerOrFloat
Source§type Output = IntegerOrFloat
type Output = IntegerOrFloat
+ operator.Source§fn add(self, rhs: IntegerOrFloat) -> <IntegerOrFloat as Add>::Output
fn add(self, rhs: IntegerOrFloat) -> <IntegerOrFloat as Add>::Output
+ operation. Read moreSource§impl ApproxEq for IntegerOrFloat
impl ApproxEq for IntegerOrFloat
Source§type Margin = F32Margin
type Margin = F32Margin
Default so that
approx_eq() can be called on unknown types.Source§fn approx_eq<M>(self, other: IntegerOrFloat, margin: M) -> bool
fn approx_eq<M>(self, other: IntegerOrFloat, margin: M) -> bool
self and other values are equal within margin
of each other.Source§impl Clone for IntegerOrFloat
impl Clone for IntegerOrFloat
Source§fn clone(&self) -> IntegerOrFloat
fn clone(&self) -> IntegerOrFloat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IntegerOrFloat
impl Debug for IntegerOrFloat
Source§impl Default for IntegerOrFloat
impl Default for IntegerOrFloat
Source§fn default() -> IntegerOrFloat
fn default() -> IntegerOrFloat
Source§impl<'de> Deserialize<'de> for IntegerOrFloat
impl<'de> Deserialize<'de> for IntegerOrFloat
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IntegerOrFloat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IntegerOrFloat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for IntegerOrFloat
impl Display for IntegerOrFloat
Source§impl Div<f32> for IntegerOrFloat
impl Div<f32> for IntegerOrFloat
Source§impl Div<f64> for IntegerOrFloat
impl Div<f64> for IntegerOrFloat
Source§impl Div<i16> for IntegerOrFloat
impl Div<i16> for IntegerOrFloat
Source§impl Div<i32> for IntegerOrFloat
impl Div<i32> for IntegerOrFloat
Source§impl Div<i64> for IntegerOrFloat
impl Div<i64> for IntegerOrFloat
Source§impl Div<i8> for IntegerOrFloat
impl Div<i8> for IntegerOrFloat
Source§impl Div<isize> for IntegerOrFloat
impl Div<isize> for IntegerOrFloat
Source§impl Div<u16> for IntegerOrFloat
impl Div<u16> for IntegerOrFloat
Source§impl Div<u32> for IntegerOrFloat
impl Div<u32> for IntegerOrFloat
Source§impl Div<u64> for IntegerOrFloat
impl Div<u64> for IntegerOrFloat
Source§impl Div<u8> for IntegerOrFloat
impl Div<u8> for IntegerOrFloat
Source§impl Div<usize> for IntegerOrFloat
impl Div<usize> for IntegerOrFloat
Source§impl Div for IntegerOrFloat
impl Div for IntegerOrFloat
Source§type Output = IntegerOrFloat
type Output = IntegerOrFloat
/ operator.Source§fn div(self, rhs: IntegerOrFloat) -> <IntegerOrFloat as Div>::Output
fn div(self, rhs: IntegerOrFloat) -> <IntegerOrFloat as Div>::Output
/ operation. Read moreSource§impl Float for IntegerOrFloat
impl Float for IntegerOrFloat
Source§fn powi(self, rhs: i32) -> IntegerOrFloat
fn powi(self, rhs: i32) -> IntegerOrFloat
note: powi always i32 regardless of i_iof
Source§fn nan() -> IntegerOrFloat
fn nan() -> IntegerOrFloat
NaN value. Read moreSource§fn infinity() -> IntegerOrFloat
fn infinity() -> IntegerOrFloat
Source§fn neg_infinity() -> IntegerOrFloat
fn neg_infinity() -> IntegerOrFloat
Source§fn neg_zero() -> IntegerOrFloat
fn neg_zero() -> IntegerOrFloat
-0.0. Read moreSource§fn min_value() -> IntegerOrFloat
fn min_value() -> IntegerOrFloat
Source§fn min_positive_value() -> IntegerOrFloat
fn min_positive_value() -> IntegerOrFloat
Source§fn max_value() -> IntegerOrFloat
fn max_value() -> IntegerOrFloat
Source§fn is_infinite(self) -> bool
fn is_infinite(self) -> bool
true if this value is positive infinity or negative infinity and
false otherwise. Read moreSource§fn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
Source§fn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
true if self is negative, including -0.0,
Float::neg_infinity(), and -Float::nan(). Read moreSource§fn classify(self) -> FpCategory
fn classify(self) -> FpCategory
Source§fn floor(self) -> IntegerOrFloat
fn floor(self) -> IntegerOrFloat
Source§fn ceil(self) -> IntegerOrFloat
fn ceil(self) -> IntegerOrFloat
Source§fn round(self) -> IntegerOrFloat
fn round(self) -> IntegerOrFloat
0.0. Read moreSource§fn trunc(self) -> IntegerOrFloat
fn trunc(self) -> IntegerOrFloat
Source§fn fract(self) -> IntegerOrFloat
fn fract(self) -> IntegerOrFloat
Source§fn abs(self) -> IntegerOrFloat
fn abs(self) -> IntegerOrFloat
Source§fn signum(self) -> IntegerOrFloat
fn signum(self) -> IntegerOrFloat
self. Read moreSource§fn recip(self) -> IntegerOrFloat
fn recip(self) -> IntegerOrFloat
1/x. Read moreSource§fn sqrt(self) -> IntegerOrFloat
fn sqrt(self) -> IntegerOrFloat
Source§fn exp(self) -> IntegerOrFloat
fn exp(self) -> IntegerOrFloat
e^(self), (the exponential function). Read moreSource§fn exp2(self) -> IntegerOrFloat
fn exp2(self) -> IntegerOrFloat
2^(self). Read moreSource§fn ln(self) -> IntegerOrFloat
fn ln(self) -> IntegerOrFloat
Source§fn log2(self) -> IntegerOrFloat
fn log2(self) -> IntegerOrFloat
Source§fn log10(self) -> IntegerOrFloat
fn log10(self) -> IntegerOrFloat
Source§fn cbrt(self) -> IntegerOrFloat
fn cbrt(self) -> IntegerOrFloat
Source§fn sin(self) -> IntegerOrFloat
fn sin(self) -> IntegerOrFloat
Source§fn cos(self) -> IntegerOrFloat
fn cos(self) -> IntegerOrFloat
Source§fn tan(self) -> IntegerOrFloat
fn tan(self) -> IntegerOrFloat
Source§fn asin(self) -> IntegerOrFloat
fn asin(self) -> IntegerOrFloat
Source§fn acos(self) -> IntegerOrFloat
fn acos(self) -> IntegerOrFloat
Source§fn atan(self) -> IntegerOrFloat
fn atan(self) -> IntegerOrFloat
Source§fn exp_m1(self) -> IntegerOrFloat
fn exp_m1(self) -> IntegerOrFloat
e^(self) - 1 in a way that is accurate even if the
number is close to zero. Read moreSource§fn ln_1p(self) -> IntegerOrFloat
fn ln_1p(self) -> IntegerOrFloat
ln(1+n) (natural logarithm) more accurately than if
the operations were performed separately. Read moreSource§fn sinh(self) -> IntegerOrFloat
fn sinh(self) -> IntegerOrFloat
Source§fn cosh(self) -> IntegerOrFloat
fn cosh(self) -> IntegerOrFloat
Source§fn tanh(self) -> IntegerOrFloat
fn tanh(self) -> IntegerOrFloat
Source§fn asinh(self) -> IntegerOrFloat
fn asinh(self) -> IntegerOrFloat
Source§fn acosh(self) -> IntegerOrFloat
fn acosh(self) -> IntegerOrFloat
Source§fn atanh(self) -> IntegerOrFloat
fn atanh(self) -> IntegerOrFloat
Source§fn mul_add(self, rhs: IntegerOrFloat, rhs2: IntegerOrFloat) -> IntegerOrFloat
fn mul_add(self, rhs: IntegerOrFloat, rhs2: IntegerOrFloat) -> IntegerOrFloat
(self * a) + b with only one rounding
error, yielding a more accurate result than an unfused multiply-add. Read moreSource§fn powf(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn powf(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Source§fn log(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn log(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Source§fn max(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn max(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Source§fn min(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn min(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Source§fn hypot(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn hypot(self, rhs: IntegerOrFloat) -> IntegerOrFloat
x and y. Read moreSource§fn atan2(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn atan2(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Source§fn integer_decode(self) -> (u64, i16, i8)
fn integer_decode(self) -> (u64, i16, i8)
sign * mantissa * 2 ^ exponent. Read moreSource§fn sin_cos(self) -> (IntegerOrFloat, IntegerOrFloat)
fn sin_cos(self) -> (IntegerOrFloat, IntegerOrFloat)
Source§fn abs_sub(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn abs_sub(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Source§fn to_degrees(self) -> Self
fn to_degrees(self) -> Self
Source§fn to_radians(self) -> Self
fn to_radians(self) -> Self
Source§impl From<IntegerOrFloat> for String
impl From<IntegerOrFloat> for String
Source§fn from(iof: IntegerOrFloat) -> String
fn from(iof: IntegerOrFloat) -> String
Source§impl From<f32> for IntegerOrFloat
impl From<f32> for IntegerOrFloat
Source§fn from(p: f32) -> IntegerOrFloat
fn from(p: f32) -> IntegerOrFloat
Source§impl From<f64> for IntegerOrFloat
impl From<f64> for IntegerOrFloat
Source§fn from(p: f64) -> IntegerOrFloat
fn from(p: f64) -> IntegerOrFloat
Source§impl From<i16> for IntegerOrFloat
impl From<i16> for IntegerOrFloat
Source§fn from(p: i16) -> IntegerOrFloat
fn from(p: i16) -> IntegerOrFloat
Source§impl From<i32> for IntegerOrFloat
impl From<i32> for IntegerOrFloat
Source§fn from(p: i32) -> IntegerOrFloat
fn from(p: i32) -> IntegerOrFloat
Source§impl From<i64> for IntegerOrFloat
impl From<i64> for IntegerOrFloat
Source§fn from(p: i64) -> IntegerOrFloat
fn from(p: i64) -> IntegerOrFloat
Source§impl From<i8> for IntegerOrFloat
impl From<i8> for IntegerOrFloat
Source§fn from(p: i8) -> IntegerOrFloat
fn from(p: i8) -> IntegerOrFloat
Source§impl From<isize> for IntegerOrFloat
impl From<isize> for IntegerOrFloat
Source§fn from(p: isize) -> IntegerOrFloat
fn from(p: isize) -> IntegerOrFloat
Source§impl From<u16> for IntegerOrFloat
impl From<u16> for IntegerOrFloat
Source§fn from(p: u16) -> IntegerOrFloat
fn from(p: u16) -> IntegerOrFloat
Source§impl From<u32> for IntegerOrFloat
impl From<u32> for IntegerOrFloat
Source§fn from(p: u32) -> IntegerOrFloat
fn from(p: u32) -> IntegerOrFloat
Source§impl From<u64> for IntegerOrFloat
impl From<u64> for IntegerOrFloat
Source§fn from(p: u64) -> IntegerOrFloat
fn from(p: u64) -> IntegerOrFloat
Source§impl From<u8> for IntegerOrFloat
impl From<u8> for IntegerOrFloat
Source§fn from(p: u8) -> IntegerOrFloat
fn from(p: u8) -> IntegerOrFloat
Source§impl From<usize> for IntegerOrFloat
impl From<usize> for IntegerOrFloat
Source§fn from(p: usize) -> IntegerOrFloat
fn from(p: usize) -> IntegerOrFloat
Source§impl FromStr for IntegerOrFloat
impl FromStr for IntegerOrFloat
Source§type Err = ConversionError<ParseFloatError>
type Err = ConversionError<ParseFloatError>
Source§fn from_str(s: &str) -> Result<IntegerOrFloat, <IntegerOrFloat as FromStr>::Err>
fn from_str(s: &str) -> Result<IntegerOrFloat, <IntegerOrFloat as FromStr>::Err>
s to return a value of this type. Read moreSource§impl Hash for IntegerOrFloat
impl Hash for IntegerOrFloat
Source§impl Mul<f32> for IntegerOrFloat
impl Mul<f32> for IntegerOrFloat
Source§impl Mul<f64> for IntegerOrFloat
impl Mul<f64> for IntegerOrFloat
Source§impl Mul<i16> for IntegerOrFloat
impl Mul<i16> for IntegerOrFloat
Source§impl Mul<i32> for IntegerOrFloat
impl Mul<i32> for IntegerOrFloat
Source§impl Mul<i64> for IntegerOrFloat
impl Mul<i64> for IntegerOrFloat
Source§impl Mul<i8> for IntegerOrFloat
impl Mul<i8> for IntegerOrFloat
Source§impl Mul<isize> for IntegerOrFloat
impl Mul<isize> for IntegerOrFloat
Source§impl Mul<u16> for IntegerOrFloat
impl Mul<u16> for IntegerOrFloat
Source§impl Mul<u32> for IntegerOrFloat
impl Mul<u32> for IntegerOrFloat
Source§impl Mul<u64> for IntegerOrFloat
impl Mul<u64> for IntegerOrFloat
Source§impl Mul<u8> for IntegerOrFloat
impl Mul<u8> for IntegerOrFloat
Source§impl Mul<usize> for IntegerOrFloat
impl Mul<usize> for IntegerOrFloat
Source§impl Mul for IntegerOrFloat
impl Mul for IntegerOrFloat
Source§type Output = IntegerOrFloat
type Output = IntegerOrFloat
* operator.Source§fn mul(self, rhs: IntegerOrFloat) -> <IntegerOrFloat as Mul>::Output
fn mul(self, rhs: IntegerOrFloat) -> <IntegerOrFloat as Mul>::Output
* operation. Read moreSource§impl Neg for IntegerOrFloat
impl Neg for IntegerOrFloat
Source§impl Num for IntegerOrFloat
impl Num for IntegerOrFloat
type FromStrRadixErr = ConversionError<ParseFloatError>
Source§fn from_str_radix(
s: &str,
radix: u32,
) -> Result<IntegerOrFloat, <IntegerOrFloat as Num>::FromStrRadixErr>
fn from_str_radix( s: &str, radix: u32, ) -> Result<IntegerOrFloat, <IntegerOrFloat as Num>::FromStrRadixErr>
2..=36). Read moreSource§impl NumCast for IntegerOrFloat
impl NumCast for IntegerOrFloat
Source§fn from<N>(num: N) -> Option<IntegerOrFloat>where
N: ToPrimitive,
fn from<N>(num: N) -> Option<IntegerOrFloat>where
N: ToPrimitive,
ToPrimitive trait. If the source value cannot be
represented by the target type, then None is returned. Read moreSource§impl One for IntegerOrFloat
impl One for IntegerOrFloat
Source§impl PartialEq for IntegerOrFloat
impl PartialEq for IntegerOrFloat
Source§impl PartialOrd for IntegerOrFloat
impl PartialOrd for IntegerOrFloat
Source§impl Rem<f32> for IntegerOrFloat
impl Rem<f32> for IntegerOrFloat
Source§impl Rem<f64> for IntegerOrFloat
impl Rem<f64> for IntegerOrFloat
Source§impl Rem<i16> for IntegerOrFloat
impl Rem<i16> for IntegerOrFloat
Source§impl Rem<i32> for IntegerOrFloat
impl Rem<i32> for IntegerOrFloat
Source§impl Rem<i64> for IntegerOrFloat
impl Rem<i64> for IntegerOrFloat
Source§impl Rem<i8> for IntegerOrFloat
impl Rem<i8> for IntegerOrFloat
Source§impl Rem<isize> for IntegerOrFloat
impl Rem<isize> for IntegerOrFloat
Source§impl Rem<u16> for IntegerOrFloat
impl Rem<u16> for IntegerOrFloat
Source§impl Rem<u32> for IntegerOrFloat
impl Rem<u32> for IntegerOrFloat
Source§impl Rem<u64> for IntegerOrFloat
impl Rem<u64> for IntegerOrFloat
Source§impl Rem<u8> for IntegerOrFloat
impl Rem<u8> for IntegerOrFloat
Source§impl Rem<usize> for IntegerOrFloat
impl Rem<usize> for IntegerOrFloat
Source§impl Rem for IntegerOrFloat
impl Rem for IntegerOrFloat
Source§type Output = IntegerOrFloat
type Output = IntegerOrFloat
% operator.Source§fn rem(self, rhs: IntegerOrFloat) -> <IntegerOrFloat as Rem>::Output
fn rem(self, rhs: IntegerOrFloat) -> <IntegerOrFloat as Rem>::Output
% operation. Read moreSource§impl Serialize for IntegerOrFloat
impl Serialize for IntegerOrFloat
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl Sub<f32> for IntegerOrFloat
impl Sub<f32> for IntegerOrFloat
Source§impl Sub<f64> for IntegerOrFloat
impl Sub<f64> for IntegerOrFloat
Source§impl Sub<i16> for IntegerOrFloat
impl Sub<i16> for IntegerOrFloat
Source§impl Sub<i32> for IntegerOrFloat
impl Sub<i32> for IntegerOrFloat
Source§impl Sub<i64> for IntegerOrFloat
impl Sub<i64> for IntegerOrFloat
Source§impl Sub<i8> for IntegerOrFloat
impl Sub<i8> for IntegerOrFloat
Source§impl Sub<isize> for IntegerOrFloat
impl Sub<isize> for IntegerOrFloat
Source§impl Sub<u16> for IntegerOrFloat
impl Sub<u16> for IntegerOrFloat
Source§impl Sub<u32> for IntegerOrFloat
impl Sub<u32> for IntegerOrFloat
Source§impl Sub<u64> for IntegerOrFloat
impl Sub<u64> for IntegerOrFloat
Source§impl Sub<u8> for IntegerOrFloat
impl Sub<u8> for IntegerOrFloat
Source§impl Sub<usize> for IntegerOrFloat
impl Sub<usize> for IntegerOrFloat
Source§impl Sub for IntegerOrFloat
impl Sub for IntegerOrFloat
Source§type Output = IntegerOrFloat
type Output = IntegerOrFloat
- operator.Source§fn sub(self, rhs: IntegerOrFloat) -> <IntegerOrFloat as Sub>::Output
fn sub(self, rhs: IntegerOrFloat) -> <IntegerOrFloat as Sub>::Output
- operation. Read moreSource§impl ToPrimitive for IntegerOrFloat
impl ToPrimitive for IntegerOrFloat
Source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
self to a u64. If the value cannot be
represented by a u64, then None is returned.Source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
self to an i64. If the value cannot be
represented by an i64, then None is returned.Source§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
self to an isize. If the value cannot be
represented by an isize, then None is returned.Source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
self to an i8. If the value cannot be
represented by an i8, then None is returned.Source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
self to an i16. If the value cannot be
represented by an i16, then None is returned.Source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
self to an i32. If the value cannot be
represented by an i32, then None is returned.Source§fn to_i128(&self) -> Option<i128>
fn to_i128(&self) -> Option<i128>
self to an i128. If the value cannot be
represented by an i128 (i64 under the default implementation), then
None is returned. Read moreSource§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
self to a usize. If the value cannot be
represented by a usize, then None is returned.Source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
self to a u8. If the value cannot be
represented by a u8, then None is returned.Source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
self to a u16. If the value cannot be
represented by a u16, then None is returned.Source§fn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
self to a u32. If the value cannot be
represented by a u32, then None is returned.Source§fn to_u128(&self) -> Option<u128>
fn to_u128(&self) -> Option<u128>
self to a u128. If the value cannot be
represented by a u128 (u64 under the default implementation), then
None is returned. Read moreSource§impl TryFrom<&str> for IntegerOrFloat
impl TryFrom<&str> for IntegerOrFloat
Source§type Error = ConversionError<ParseFloatError>
type Error = ConversionError<ParseFloatError>
Source§fn try_from(
s: &str,
) -> Result<IntegerOrFloat, <IntegerOrFloat as TryFrom<&str>>::Error>
fn try_from( s: &str, ) -> Result<IntegerOrFloat, <IntegerOrFloat as TryFrom<&str>>::Error>
Source§impl Ulps for IntegerOrFloat
impl Ulps for IntegerOrFloat
type U = IntegerOrFloat
Source§fn ulps(&self, other: &IntegerOrFloat) -> IntegerOrFloat
fn ulps(&self, other: &IntegerOrFloat) -> IntegerOrFloat
self and other. The result U is an integral value, and will
be zero if self and other are exactly equal.Source§fn next(&self) -> IntegerOrFloat
fn next(&self) -> IntegerOrFloat
Source§fn prev(&self) -> IntegerOrFloat
fn prev(&self) -> IntegerOrFloat
Source§impl Zero for IntegerOrFloat
impl Zero for IntegerOrFloat
impl Copy for IntegerOrFloat
impl Eq for IntegerOrFloat
Auto Trait Implementations§
impl Freeze for IntegerOrFloat
impl RefUnwindSafe for IntegerOrFloat
impl Send for IntegerOrFloat
impl Sync for IntegerOrFloat
impl Unpin for IntegerOrFloat
impl UnwindSafe for IntegerOrFloat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Real for Twhere
T: Float,
impl<T> Real for Twhere
T: Float,
Source§fn min_positive_value() -> T
fn min_positive_value() -> T
Source§fn round(self) -> T
fn round(self) -> T
0.0. Read moreSource§fn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
true if self is positive, including +0.0,
Float::infinity(), and with newer versions of Rust f64::NAN. Read moreSource§fn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
true if self is negative, including -0.0,
Float::neg_infinity(), and with newer versions of Rust -f64::NAN. Read moreSource§fn mul_add(self, a: T, b: T) -> T
fn mul_add(self, a: T, b: T) -> T
(self * a) + b with only one rounding
error, yielding a more accurate result than an unfused multiply-add. Read moreSource§fn log(self, base: T) -> T
fn log(self, base: T) -> T
Source§fn to_degrees(self) -> T
fn to_degrees(self) -> T
Source§fn to_radians(self) -> T
fn to_radians(self) -> T
Source§fn hypot(self, other: T) -> T
fn hypot(self, other: T) -> T
x and y. Read moreSource§fn asin(self) -> T
fn asin(self) -> T
Source§fn acos(self) -> T
fn acos(self) -> T
Source§fn atan(self) -> T
fn atan(self) -> T
Source§fn exp_m1(self) -> T
fn exp_m1(self) -> T
e^(self) - 1 in a way that is accurate even if the
number is close to zero. Read more