pub enum IntegerOrFloat {
Integer(i_iof),
Float(f_iof),
}Expand description
A generic container for an “integer or a float”.
Was made originally for the UFO data type “integer or float”.
Variants§
Integer(i_iof)
An integer: normally i32, but if compiled with x64-backing-store feature, can be an
f64.
Float(f_iof)
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<i_iof, f_iof>
pub fn holding_integer(&self) -> Result<i_iof, f_iof>
If we’re holding an integer return it, else return in the Err variant our float.
Sourcepub fn holding_float(&self) -> Result<f_iof, i_iof>
pub fn holding_float(&self) -> Result<f_iof, i_iof>
If we’re holding a float return it, else return in the Err variant our integer.
Sourcepub fn unwrap_float(&self) -> f_iof
pub fn unwrap_float(&self) -> f_iof
Give back the float we’re holding…panic if we’re holding an integer.
Sourcepub fn unwrap_integer(&self) -> i_iof
pub fn unwrap_integer(&self) -> i_iof
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: u_iof) -> Self
pub fn from_bits(bits: u_iof) -> Self
Cf. f_iof::from_bits
Sourcepub fn to_bits(&self) -> u_iof
pub fn to_bits(&self) -> u_iof
Cf. f_iof::to_bits
Trait Implementations§
Source§impl Add<IntegerOrFloat> for f32
impl Add<IntegerOrFloat> for f32
Source§impl Add<IntegerOrFloat> for f64
impl Add<IntegerOrFloat> for f64
Source§impl Add<IntegerOrFloat> for i16
impl Add<IntegerOrFloat> for i16
Source§impl Add<IntegerOrFloat> for i32
impl Add<IntegerOrFloat> for i32
Source§impl Add<IntegerOrFloat> for i64
impl Add<IntegerOrFloat> for i64
Source§impl Add<IntegerOrFloat> for i8
impl Add<IntegerOrFloat> for i8
Source§impl Add<IntegerOrFloat> for isize
impl Add<IntegerOrFloat> for isize
Source§impl Add<IntegerOrFloat> for u16
impl Add<IntegerOrFloat> for u16
Source§impl Add<IntegerOrFloat> for u32
impl Add<IntegerOrFloat> for u32
Source§impl Add<IntegerOrFloat> for u64
impl Add<IntegerOrFloat> for u64
Source§impl Add<IntegerOrFloat> for u8
impl Add<IntegerOrFloat> for u8
Source§impl Add<IntegerOrFloat> for usize
impl Add<IntegerOrFloat> for usize
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§impl ApproxEq for IntegerOrFloat
impl ApproxEq for IntegerOrFloat
Source§type Margin = F32Margin
type Margin = F32Margin
This type type defines a margin within which two values are to be
considered approximately equal. It must implement
Default so that
approx_eq() can be called on unknown types.Source§impl Clone for IntegerOrFloat
impl Clone for IntegerOrFloat
Source§fn clone(&self) -> IntegerOrFloat
fn clone(&self) -> IntegerOrFloat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IntegerOrFloat
impl Debug for IntegerOrFloat
Source§impl Default for IntegerOrFloat
impl Default for IntegerOrFloat
Source§impl Display for IntegerOrFloat
impl Display for IntegerOrFloat
Source§impl Div<IntegerOrFloat> for f32
impl Div<IntegerOrFloat> for f32
Source§impl Div<IntegerOrFloat> for f64
impl Div<IntegerOrFloat> for f64
Source§impl Div<IntegerOrFloat> for i16
impl Div<IntegerOrFloat> for i16
Source§impl Div<IntegerOrFloat> for i32
impl Div<IntegerOrFloat> for i32
Source§impl Div<IntegerOrFloat> for i64
impl Div<IntegerOrFloat> for i64
Source§impl Div<IntegerOrFloat> for i8
impl Div<IntegerOrFloat> for i8
Source§impl Div<IntegerOrFloat> for isize
impl Div<IntegerOrFloat> for isize
Source§impl Div<IntegerOrFloat> for u16
impl Div<IntegerOrFloat> for u16
Source§impl Div<IntegerOrFloat> for u32
impl Div<IntegerOrFloat> for u32
Source§impl Div<IntegerOrFloat> for u64
impl Div<IntegerOrFloat> for u64
Source§impl Div<IntegerOrFloat> for u8
impl Div<IntegerOrFloat> for u8
Source§impl Div<IntegerOrFloat> for usize
impl Div<IntegerOrFloat> for usize
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§impl Float for IntegerOrFloat
impl Float for IntegerOrFloat
Source§fn neg_infinity() -> Self
fn neg_infinity() -> Self
Returns the negative infinite value. Read more
Source§fn min_value() -> Self
fn min_value() -> Self
Returns the smallest finite value that this type can represent. Read more
Source§fn min_positive_value() -> Self
fn min_positive_value() -> Self
Returns the smallest positive, normalized value that this type can represent. Read more
Source§fn max_value() -> Self
fn max_value() -> Self
Returns the largest finite value that this type can represent. Read more
Source§fn is_infinite(self) -> bool
fn is_infinite(self) -> bool
Returns
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
Returns
true if self is negative, including -0.0,
Float::neg_infinity(), and -Float::nan(). Read moreSource§fn classify(self) -> FpCategory
fn classify(self) -> FpCategory
Returns the floating point category of the number. If only one property
is going to be tested, it is generally faster to use the specific
predicate instead. Read more
Source§fn ceil(self) -> Self
fn ceil(self) -> Self
Returns the smallest integer greater than or equal to a number. Read more
Source§fn round(self) -> Self
fn round(self) -> Self
Returns the nearest integer to a number. Round half-way cases away from
0.0. Read moreSource§fn asin(self) -> Self
fn asin(self) -> Self
Computes the arcsine of a number. Return value is in radians in
the range [-pi/2, pi/2] or NaN if the number is outside the range
[-1, 1]. Read more
Source§fn acos(self) -> Self
fn acos(self) -> Self
Computes the arccosine of a number. Return value is in radians in
the range [0, pi] or NaN if the number is outside the range
[-1, 1]. Read more
Source§fn atan(self) -> Self
fn atan(self) -> Self
Computes the arctangent of a number. Return value is in radians in the
range [-pi/2, pi/2]; Read more
Source§fn exp_m1(self) -> Self
fn exp_m1(self) -> Self
Returns
e^(self) - 1 in a way that is accurate even if the
number is close to zero. Read moreSource§fn ln_1p(self) -> Self
fn ln_1p(self) -> Self
Returns
ln(1+n) (natural logarithm) more accurately than if
the operations were performed separately. Read moreSource§fn mul_add(self, rhs: Self, rhs2: Self) -> Self
fn mul_add(self, rhs: Self, rhs2: Self) -> Self
Fused multiply-add. Computes
(self * a) + b with only one rounding
error, yielding a more accurate result than an unfused multiply-add. Read moreSource§fn log(self, rhs: Self) -> Self
fn log(self, rhs: Self) -> Self
Returns the logarithm of the number with respect to an arbitrary base. Read more
Source§fn hypot(self, rhs: Self) -> Self
fn hypot(self, rhs: Self) -> Self
Calculate the length of the hypotenuse of a right-angle triangle given
legs of length
x and y. Read moreSource§fn integer_decode(self) -> (u64, i16, i8)
fn integer_decode(self) -> (u64, i16, i8)
Returns the mantissa, base 2 exponent, and sign as integers, respectively.
The original number can be recovered by
sign * mantissa * 2 ^ exponent. Read moreSource§fn to_degrees(self) -> Self
fn to_degrees(self) -> Self
Converts radians to degrees. Read more
Source§fn to_radians(self) -> Self
fn to_radians(self) -> Self
Converts degrees to radians. Read more
Source§impl From<IntegerOrFloat> for String
Available on std only.
impl From<IntegerOrFloat> for String
Available on
std only.Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for f32
impl From<IntegerOrFloat> for f32
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for f64
impl From<IntegerOrFloat> for f64
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for i16
impl From<IntegerOrFloat> for i16
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for i32
impl From<IntegerOrFloat> for i32
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for i64
impl From<IntegerOrFloat> for i64
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for i8
impl From<IntegerOrFloat> for i8
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for isize
impl From<IntegerOrFloat> for isize
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for u16
impl From<IntegerOrFloat> for u16
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for u32
impl From<IntegerOrFloat> for u32
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for u64
impl From<IntegerOrFloat> for u64
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for u8
impl From<IntegerOrFloat> for u8
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<IntegerOrFloat> for usize
impl From<IntegerOrFloat> for usize
Source§fn from(iof: IntegerOrFloat) -> Self
fn from(iof: IntegerOrFloat) -> Self
Converts to this type from the input type.
Source§impl From<f32> for IntegerOrFloat
impl From<f32> for IntegerOrFloat
Source§impl From<f64> for IntegerOrFloat
impl From<f64> for IntegerOrFloat
Source§impl From<i16> for IntegerOrFloat
impl From<i16> for IntegerOrFloat
Source§impl From<i32> for IntegerOrFloat
impl From<i32> for IntegerOrFloat
Source§impl From<i64> for IntegerOrFloat
impl From<i64> for IntegerOrFloat
Source§impl From<i8> for IntegerOrFloat
impl From<i8> for IntegerOrFloat
Source§impl From<isize> for IntegerOrFloat
impl From<isize> for IntegerOrFloat
Source§impl From<u16> for IntegerOrFloat
impl From<u16> for IntegerOrFloat
Source§impl From<u32> for IntegerOrFloat
impl From<u32> for IntegerOrFloat
Source§impl From<u64> for IntegerOrFloat
impl From<u64> for IntegerOrFloat
Source§impl From<u8> for IntegerOrFloat
impl From<u8> for IntegerOrFloat
Source§impl From<usize> for IntegerOrFloat
impl From<usize> for IntegerOrFloat
Source§impl FromStr for IntegerOrFloat
impl FromStr for IntegerOrFloat
Source§impl Mul<IntegerOrFloat> for f32
impl Mul<IntegerOrFloat> for f32
Source§impl Mul<IntegerOrFloat> for f64
impl Mul<IntegerOrFloat> for f64
Source§impl Mul<IntegerOrFloat> for i16
impl Mul<IntegerOrFloat> for i16
Source§impl Mul<IntegerOrFloat> for i32
impl Mul<IntegerOrFloat> for i32
Source§impl Mul<IntegerOrFloat> for i64
impl Mul<IntegerOrFloat> for i64
Source§impl Mul<IntegerOrFloat> for i8
impl Mul<IntegerOrFloat> for i8
Source§impl Mul<IntegerOrFloat> for isize
impl Mul<IntegerOrFloat> for isize
Source§impl Mul<IntegerOrFloat> for u16
impl Mul<IntegerOrFloat> for u16
Source§impl Mul<IntegerOrFloat> for u32
impl Mul<IntegerOrFloat> for u32
Source§impl Mul<IntegerOrFloat> for u64
impl Mul<IntegerOrFloat> for u64
Source§impl Mul<IntegerOrFloat> for u8
impl Mul<IntegerOrFloat> for u8
Source§impl Mul<IntegerOrFloat> for usize
impl Mul<IntegerOrFloat> for usize
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§impl Neg for IntegerOrFloat
impl Neg for IntegerOrFloat
Source§impl Num for IntegerOrFloat
Available on crate feature num-traits only.
impl Num for IntegerOrFloat
Available on crate feature
num-traits only.type FromStrRadixErr = ConversionError<ParseFloatError>
Source§fn from_str_radix(s: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
fn from_str_radix(s: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
Convert from a string and radix (typically
2..=36). Read moreSource§impl NumCast for IntegerOrFloat
impl NumCast for IntegerOrFloat
Source§fn from<N: ToPrimitive>(num: N) -> Option<IntegerOrFloat>
fn from<N: ToPrimitive>(num: N) -> Option<IntegerOrFloat>
Creates a number from another value that can be converted into
a primitive via the
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<IntegerOrFloat> for f32
impl Rem<IntegerOrFloat> for f32
Source§impl Rem<IntegerOrFloat> for f64
impl Rem<IntegerOrFloat> for f64
Source§impl Rem<IntegerOrFloat> for i16
impl Rem<IntegerOrFloat> for i16
Source§impl Rem<IntegerOrFloat> for i32
impl Rem<IntegerOrFloat> for i32
Source§impl Rem<IntegerOrFloat> for i64
impl Rem<IntegerOrFloat> for i64
Source§impl Rem<IntegerOrFloat> for i8
impl Rem<IntegerOrFloat> for i8
Source§impl Rem<IntegerOrFloat> for isize
impl Rem<IntegerOrFloat> for isize
Source§impl Rem<IntegerOrFloat> for u16
impl Rem<IntegerOrFloat> for u16
Source§impl Rem<IntegerOrFloat> for u32
impl Rem<IntegerOrFloat> for u32
Source§impl Rem<IntegerOrFloat> for u64
impl Rem<IntegerOrFloat> for u64
Source§impl Rem<IntegerOrFloat> for u8
impl Rem<IntegerOrFloat> for u8
Source§impl Rem<IntegerOrFloat> for usize
impl Rem<IntegerOrFloat> for usize
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§impl Sub<IntegerOrFloat> for f32
impl Sub<IntegerOrFloat> for f32
Source§impl Sub<IntegerOrFloat> for f64
impl Sub<IntegerOrFloat> for f64
Source§impl Sub<IntegerOrFloat> for i16
impl Sub<IntegerOrFloat> for i16
Source§impl Sub<IntegerOrFloat> for i32
impl Sub<IntegerOrFloat> for i32
Source§impl Sub<IntegerOrFloat> for i64
impl Sub<IntegerOrFloat> for i64
Source§impl Sub<IntegerOrFloat> for i8
impl Sub<IntegerOrFloat> for i8
Source§impl Sub<IntegerOrFloat> for isize
impl Sub<IntegerOrFloat> for isize
Source§impl Sub<IntegerOrFloat> for u16
impl Sub<IntegerOrFloat> for u16
Source§impl Sub<IntegerOrFloat> for u32
impl Sub<IntegerOrFloat> for u32
Source§impl Sub<IntegerOrFloat> for u64
impl Sub<IntegerOrFloat> for u64
Source§impl Sub<IntegerOrFloat> for u8
impl Sub<IntegerOrFloat> for u8
Source§impl Sub<IntegerOrFloat> for usize
impl Sub<IntegerOrFloat> for usize
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§impl ToPrimitive for IntegerOrFloat
Available on crate feature num-traits only.
impl ToPrimitive for IntegerOrFloat
Available on crate feature
num-traits only.Source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
Converts the value of
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>
Converts the value of
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>
Converts the value of
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>
Converts the value of
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>
Converts the value of
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>
Converts the value of
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>
Converts the value of
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>
Converts the value of
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>
Converts the value of
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>
Converts the value of
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>
Converts the value of
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>
Converts the value of
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§impl Ulps for IntegerOrFloat
impl Ulps for IntegerOrFloat
Source§impl Zero for IntegerOrFloat
impl Zero for IntegerOrFloat
impl Copy 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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
Returns the smallest positive, normalized value that this type can represent. Read more
Source§fn round(self) -> T
fn round(self) -> T
Returns the nearest integer to a number. Round half-way cases away from
0.0. Read moreSource§fn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
Returns
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
Returns
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
Fused multiply-add. Computes
(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
Returns the logarithm of the number with respect to an arbitrary base. Read more
Source§fn to_degrees(self) -> T
fn to_degrees(self) -> T
Converts radians to degrees. Read more
Source§fn to_radians(self) -> T
fn to_radians(self) -> T
Converts degrees to radians. Read more
Source§fn hypot(self, other: T) -> T
fn hypot(self, other: T) -> T
Calculate the length of the hypotenuse of a right-angle triangle given
legs of length
x and y. Read moreSource§fn asin(self) -> T
fn asin(self) -> T
Computes the arcsine of a number. Return value is in radians in
the range [-pi/2, pi/2] or NaN if the number is outside the range
[-1, 1]. Read more
Source§fn acos(self) -> T
fn acos(self) -> T
Computes the arccosine of a number. Return value is in radians in
the range [0, pi] or NaN if the number is outside the range
[-1, 1]. Read more
Source§fn atan(self) -> T
fn atan(self) -> T
Computes the arctangent of a number. Return value is in radians in the
range [-pi/2, pi/2]; Read more
Source§fn exp_m1(self) -> T
fn exp_m1(self) -> T
Returns
e^(self) - 1 in a way that is accurate even if the
number is close to zero. Read more