Enum glifparser::IntegerOrFloat
source · Expand description
A generic container for an “integer or a float”.
Was made originally for the UFO data type “integer or float”.
Variants§
Implementations§
source§impl IntegerOrFloat
impl IntegerOrFloat
pub fn holding_integer(&self) -> Result<i32, f32>
pub fn holding_float(&self) -> Result<f32, i32>
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 float we’re holding…panic if we’re holding an integer.
Trait Implementations§
source§impl Add<IntegerOrFloat> for IntegerOrFloat
impl Add<IntegerOrFloat> for IntegerOrFloat
§type Output = IntegerOrFloat
type Output = IntegerOrFloat
The resulting type after applying the
+ operator.source§fn add(
self,
rhs: IntegerOrFloat
) -> <IntegerOrFloat as Add<IntegerOrFloat>>::Output
fn add(
self,
rhs: IntegerOrFloat
) -> <IntegerOrFloat as Add<IntegerOrFloat>>::Output
Performs the
+ operation. Read moresource§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 ApproxEq for IntegerOrFloat
impl ApproxEq for IntegerOrFloat
§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§fn approx_eq<M>(self, other: IntegerOrFloat, margin: M) -> boolwhere
M: Into<<IntegerOrFloat as ApproxEq>::Margin>,
fn approx_eq<M>(self, other: IntegerOrFloat, margin: M) -> boolwhere
M: Into<<IntegerOrFloat as ApproxEq>::Margin>,
This method tests that the
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
Returns a copy 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§fn default() -> IntegerOrFloat
fn default() -> IntegerOrFloat
Returns the “default value” for a type. Read more
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for IntegerOrFloat
impl Display for IntegerOrFloat
source§impl Div<IntegerOrFloat> for IntegerOrFloat
impl Div<IntegerOrFloat> for IntegerOrFloat
§type Output = IntegerOrFloat
type Output = IntegerOrFloat
The resulting type after applying the
/ operator.source§fn div(
self,
rhs: IntegerOrFloat
) -> <IntegerOrFloat as Div<IntegerOrFloat>>::Output
fn div(
self,
rhs: IntegerOrFloat
) -> <IntegerOrFloat as Div<IntegerOrFloat>>::Output
Performs the
/ operation. Read moresource§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 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
Returns the
NaN value. Read moresource§fn infinity() -> IntegerOrFloat
fn infinity() -> IntegerOrFloat
Returns the infinite value. Read more
source§fn neg_infinity() -> IntegerOrFloat
fn neg_infinity() -> IntegerOrFloat
Returns the negative infinite value. Read more
source§fn neg_zero() -> IntegerOrFloat
fn neg_zero() -> IntegerOrFloat
Returns
-0.0. Read moresource§fn min_value() -> IntegerOrFloat
fn min_value() -> IntegerOrFloat
Returns the smallest finite value that this type can represent. Read more
source§fn min_positive_value() -> IntegerOrFloat
fn min_positive_value() -> IntegerOrFloat
Returns the smallest positive, normalized value that this type can represent. Read more
source§fn max_value() -> IntegerOrFloat
fn max_value() -> IntegerOrFloat
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
Returns
true if self is positive, including +0.0,
Float::infinity(), and since Rust 1.20 also Float::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 since Rust 1.20 also -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 floor(self) -> IntegerOrFloat
fn floor(self) -> IntegerOrFloat
Returns the largest integer less than or equal to a number. Read more
source§fn ceil(self) -> IntegerOrFloat
fn ceil(self) -> IntegerOrFloat
Returns the smallest integer greater than or equal to a number. Read more
source§fn round(self) -> IntegerOrFloat
fn round(self) -> IntegerOrFloat
Returns the nearest integer to a number. Round half-way cases away from
0.0. Read moresource§fn trunc(self) -> IntegerOrFloat
fn trunc(self) -> IntegerOrFloat
Return the integer part of a number. Read more
source§fn fract(self) -> IntegerOrFloat
fn fract(self) -> IntegerOrFloat
Returns the fractional part of a number. Read more
source§fn abs(self) -> IntegerOrFloat
fn abs(self) -> IntegerOrFloat
source§fn signum(self) -> IntegerOrFloat
fn signum(self) -> IntegerOrFloat
Returns a number that represents the sign of
self. Read moresource§fn recip(self) -> IntegerOrFloat
fn recip(self) -> IntegerOrFloat
Take the reciprocal (inverse) of a number,
1/x. Read moresource§fn sqrt(self) -> IntegerOrFloat
fn sqrt(self) -> IntegerOrFloat
Take the square root of a number. Read more
source§fn exp(self) -> IntegerOrFloat
fn exp(self) -> IntegerOrFloat
Returns
e^(self), (the exponential function). Read moresource§fn exp2(self) -> IntegerOrFloat
fn exp2(self) -> IntegerOrFloat
Returns
2^(self). Read moresource§fn ln(self) -> IntegerOrFloat
fn ln(self) -> IntegerOrFloat
Returns the natural logarithm of the number. Read more
source§fn log2(self) -> IntegerOrFloat
fn log2(self) -> IntegerOrFloat
Returns the base 2 logarithm of the number. Read more
source§fn log10(self) -> IntegerOrFloat
fn log10(self) -> IntegerOrFloat
Returns the base 10 logarithm of the number. Read more
source§fn cbrt(self) -> IntegerOrFloat
fn cbrt(self) -> IntegerOrFloat
Take the cubic root of a number. Read more
source§fn sin(self) -> IntegerOrFloat
fn sin(self) -> IntegerOrFloat
Computes the sine of a number (in radians). Read more
source§fn cos(self) -> IntegerOrFloat
fn cos(self) -> IntegerOrFloat
Computes the cosine of a number (in radians). Read more
source§fn tan(self) -> IntegerOrFloat
fn tan(self) -> IntegerOrFloat
Computes the tangent of a number (in radians). Read more
source§fn asin(self) -> IntegerOrFloat
fn asin(self) -> IntegerOrFloat
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) -> IntegerOrFloat
fn acos(self) -> IntegerOrFloat
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) -> IntegerOrFloat
fn atan(self) -> IntegerOrFloat
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) -> IntegerOrFloat
fn exp_m1(self) -> IntegerOrFloat
Returns
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
Returns
ln(1+n) (natural logarithm) more accurately than if
the operations were performed separately. Read moresource§fn sinh(self) -> IntegerOrFloat
fn sinh(self) -> IntegerOrFloat
Hyperbolic sine function. Read more
source§fn cosh(self) -> IntegerOrFloat
fn cosh(self) -> IntegerOrFloat
Hyperbolic cosine function. Read more
source§fn tanh(self) -> IntegerOrFloat
fn tanh(self) -> IntegerOrFloat
Hyperbolic tangent function. Read more
source§fn asinh(self) -> IntegerOrFloat
fn asinh(self) -> IntegerOrFloat
Inverse hyperbolic sine function. Read more
source§fn acosh(self) -> IntegerOrFloat
fn acosh(self) -> IntegerOrFloat
Inverse hyperbolic cosine function. Read more
source§fn atanh(self) -> IntegerOrFloat
fn atanh(self) -> IntegerOrFloat
Inverse hyperbolic tangent function. Read more
source§fn mul_add(self, rhs: IntegerOrFloat, rhs2: IntegerOrFloat) -> IntegerOrFloat
fn mul_add(self, rhs: IntegerOrFloat, rhs2: IntegerOrFloat) -> IntegerOrFloat
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 powf(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn powf(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Raise a number to a floating point power. Read more
source§fn log(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn log(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Returns the logarithm of the number with respect to an arbitrary base. Read more
source§fn max(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn max(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Returns the maximum of the two numbers. Read more
source§fn min(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn min(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Returns the minimum of the two numbers. Read more
source§fn hypot(self, rhs: IntegerOrFloat) -> IntegerOrFloat
fn hypot(self, rhs: IntegerOrFloat) -> IntegerOrFloat
Calculate the length of the hypotenuse of a right-angle triangle given
legs of length
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)
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 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
The positive difference of two numbers. Read more
source§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
impl From<IntegerOrFloat> for String
source§fn from(iof: IntegerOrFloat) -> String
fn from(iof: IntegerOrFloat) -> String
Converts to this type from the input type.
source§impl From<f32> for IntegerOrFloat
impl From<f32> for IntegerOrFloat
source§fn from(p: f32) -> IntegerOrFloat
fn from(p: f32) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<f64> for IntegerOrFloat
impl From<f64> for IntegerOrFloat
source§fn from(p: f64) -> IntegerOrFloat
fn from(p: f64) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<i16> for IntegerOrFloat
impl From<i16> for IntegerOrFloat
source§fn from(p: i16) -> IntegerOrFloat
fn from(p: i16) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<i32> for IntegerOrFloat
impl From<i32> for IntegerOrFloat
source§fn from(p: i32) -> IntegerOrFloat
fn from(p: i32) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<i64> for IntegerOrFloat
impl From<i64> for IntegerOrFloat
source§fn from(p: i64) -> IntegerOrFloat
fn from(p: i64) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<i8> for IntegerOrFloat
impl From<i8> for IntegerOrFloat
source§fn from(p: i8) -> IntegerOrFloat
fn from(p: i8) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<isize> for IntegerOrFloat
impl From<isize> for IntegerOrFloat
source§fn from(p: isize) -> IntegerOrFloat
fn from(p: isize) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<u16> for IntegerOrFloat
impl From<u16> for IntegerOrFloat
source§fn from(p: u16) -> IntegerOrFloat
fn from(p: u16) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<u32> for IntegerOrFloat
impl From<u32> for IntegerOrFloat
source§fn from(p: u32) -> IntegerOrFloat
fn from(p: u32) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<u64> for IntegerOrFloat
impl From<u64> for IntegerOrFloat
source§fn from(p: u64) -> IntegerOrFloat
fn from(p: u64) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<u8> for IntegerOrFloat
impl From<u8> for IntegerOrFloat
source§fn from(p: u8) -> IntegerOrFloat
fn from(p: u8) -> IntegerOrFloat
Converts to this type from the input type.
source§impl From<usize> for IntegerOrFloat
impl From<usize> for IntegerOrFloat
source§fn from(p: usize) -> IntegerOrFloat
fn from(p: usize) -> IntegerOrFloat
Converts to this type from the input type.
source§impl FromStr for IntegerOrFloat
impl FromStr for IntegerOrFloat
§type Err = ConversionError
type Err = ConversionError
The associated error which can be returned from parsing.
source§fn from_str(s: &str) -> Result<IntegerOrFloat, <IntegerOrFloat as FromStr>::Err>
fn from_str(s: &str) -> Result<IntegerOrFloat, <IntegerOrFloat as FromStr>::Err>
Parses a string
s to return a value of this type. Read moresource§impl Hash for IntegerOrFloat
impl Hash for IntegerOrFloat
source§impl Mul<IntegerOrFloat> for IntegerOrFloat
impl Mul<IntegerOrFloat> for IntegerOrFloat
§type Output = IntegerOrFloat
type Output = IntegerOrFloat
The resulting type after applying the
* operator.source§fn mul(
self,
rhs: IntegerOrFloat
) -> <IntegerOrFloat as Mul<IntegerOrFloat>>::Output
fn mul(
self,
rhs: IntegerOrFloat
) -> <IntegerOrFloat as Mul<IntegerOrFloat>>::Output
Performs the
* operation. Read moresource§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 Neg for IntegerOrFloat
impl Neg for IntegerOrFloat
§type Output = IntegerOrFloat
type Output = IntegerOrFloat
The resulting type after applying the
- operator.source§impl Num for IntegerOrFloat
impl Num for IntegerOrFloat
type FromStrRadixErr = ConversionError
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>
Convert from a string and radix (typically
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,
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<IntegerOrFloat> for IntegerOrFloat
impl PartialEq<IntegerOrFloat> for IntegerOrFloat
source§fn eq(&self, other: &IntegerOrFloat) -> bool
fn eq(&self, other: &IntegerOrFloat) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<IntegerOrFloat> for IntegerOrFloat
impl PartialOrd<IntegerOrFloat> for IntegerOrFloat
source§fn partial_cmp(&self, other: &IntegerOrFloat) -> Option<Ordering>
fn partial_cmp(&self, other: &IntegerOrFloat) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Rem<IntegerOrFloat> for IntegerOrFloat
impl Rem<IntegerOrFloat> for IntegerOrFloat
§type Output = IntegerOrFloat
type Output = IntegerOrFloat
The resulting type after applying the
% operator.source§fn rem(
self,
rhs: IntegerOrFloat
) -> <IntegerOrFloat as Rem<IntegerOrFloat>>::Output
fn rem(
self,
rhs: IntegerOrFloat
) -> <IntegerOrFloat as Rem<IntegerOrFloat>>::Output
Performs the
% operation. Read moresource§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 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,
Serialize this value into the given Serde serializer. Read more
source§impl Sub<IntegerOrFloat> for IntegerOrFloat
impl Sub<IntegerOrFloat> for IntegerOrFloat
§type Output = IntegerOrFloat
type Output = IntegerOrFloat
The resulting type after applying the
- operator.source§fn sub(
self,
rhs: IntegerOrFloat
) -> <IntegerOrFloat as Sub<IntegerOrFloat>>::Output
fn sub(
self,
rhs: IntegerOrFloat
) -> <IntegerOrFloat as Sub<IntegerOrFloat>>::Output
Performs the
- operation. Read moresource§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 ToPrimitive for IntegerOrFloat
impl ToPrimitive for IntegerOrFloat
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
§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
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>
Performs the conversion.
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
The number of representable values or ULPs (Units of Least Precision) that
separate
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
The next representable number above this one
source§fn prev(&self) -> IntegerOrFloat
fn prev(&self) -> IntegerOrFloat
The previous representable number below this one
source§impl Zero for IntegerOrFloat
impl Zero for IntegerOrFloat
impl Copy for IntegerOrFloat
Auto Trait Implementations§
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> 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