[−][src]Struct decorum::ConstrainedFloat
Floating-point proxy that provides a total ordering, equivalence, hashing, and constraints.
ConstrainedFloat
wraps primitive floating-point types and provides
implementations for numeric traits using a total ordering, including Ord
,
Eq
, and Hash
. ConstrainedFloat
supports various constraints on the
class of values that may be represented and panics if these constraints are
violated.
This type is re-exported but should not (and cannot) be used directly. Use
the type aliases Total
, NotNan
, and Finite
instead.
Total Ordering
All proxy types use the following total ordering:
$$-\infin<\cdots<0<\cdots<\infin<\text{NaN}$$
See the cmp
module for a description of the total ordering used to
implement Ord
and Eq
.
Constraints
Constraints restrict the set of values that a proxy may take by disallowing certain classes or subsets of those values. If a constraint is violated (because a proxy type would need to take a value it disallows), the operation panics.
Constraints may disallow two broad classes of floating-point values:
infinities and NaN
s. Constraints are exposed by the Total
, NotNan
, and
Finite
type definitions. Note that Total
uses a unit constraint, which
enforces no constraints at all and never panics.
Implementations
impl<T, P> ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
pub fn from_inner(value: T) -> Self
[src]
Converts a primitive floating-point value into a proxy.
The same behavior is provided by an implementation of the From
trait.
Panics
This conversion and the implementation of the From
trait will panic
if the primitive floating-point value violates the constraints of the
proxy.
Examples
Converting primitive floating-point values into proxies:
use decorum::R64; fn f(x: R64) -> R64 { x * 2.0 } // Conversion using `from_inner`. let y = f(R64::from_inner(2.0)); // Conversion using `From`/`Into`. let z = f(2.0.into());
Performing a conversion that panics:
use decorum::R64; // `R64` does not allow `NaN`s, but `0.0 / 0.0` produces a `NaN`. let x = R64::from_inner(0.0 / 0.0); // Panics.
pub fn into_inner(self) -> T
[src]
Converts a proxy into a primitive floating-point value.
Examples
Converting a proxy into a primitive floating-point value:
use decorum::R64; fn f() -> R64 { // ... } let x: f64 = f().into_inner();
pub fn from_subset<Q>(other: ConstrainedFloat<T, Q>) -> Self where
Q: Constraint<T> + SubsetOf<P>,
[src]
Q: Constraint<T> + SubsetOf<P>,
Converts a proxy into another proxy that is capable of representing a superset of the values that are members of its constraint.
Examples
Converting between compatible proxy types:
use decorum::{N64, R64}; use num::Zero; let x = R64::zero(); let y = N64::from_subset(x);
pub fn into_superset<Q>(self) -> ConstrainedFloat<T, Q> where
Q: Constraint<T> + SupersetOf<P>,
[src]
Q: Constraint<T> + SupersetOf<P>,
Converts a proxy into another proxy that is capable of representing a superset of the values that are members of its constraint.
Examples
Converting between compatible proxy types:
use decorum::{N64, R64}; use num::Zero; let x = R64::zero(); let y: N64 = x.into_superset();
Trait Implementations
impl<T, P> AbsDiffEq<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: AbsDiffEq<Epsilon = T> + Float + Primitive,
P: Constraint<T>,
[src]
T: AbsDiffEq<Epsilon = T> + Float + Primitive,
P: Constraint<T>,
type Epsilon = Self
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
impl<T, P> Add<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self::Output
[src]
impl<T, P> Add<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: T) -> Self::Output
[src]
impl<T, P> AddAssign<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn add_assign(&mut self, other: Self)
[src]
impl<T, P> AddAssign<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn add_assign(&mut self, other: T)
[src]
impl<T, P> AsRef<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
impl<T, P> Bounded for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
impl<T: Clone, P: Clone> Clone for ConstrainedFloat<T, P>
[src]
fn clone(&self) -> ConstrainedFloat<T, P>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy, P: Copy> Copy for ConstrainedFloat<T, P>
[src]
impl<T, P> Default for ConstrainedFloat<T, P> where
T: Default + Float + Primitive,
P: Constraint<T>,
[src]
T: Default + Float + Primitive,
P: Constraint<T>,
impl<'de, T, P> Deserialize<'de> for ConstrainedFloat<T, P> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T, P> Display for ConstrainedFloat<T, P> where
T: Display + Float + Primitive,
P: Constraint<T>,
[src]
T: Display + Float + Primitive,
P: Constraint<T>,
impl<T, P> Div<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self::Output
[src]
impl<T, P> Div<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: T) -> Self::Output
[src]
impl<T, P> DivAssign<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn div_assign(&mut self, other: Self)
[src]
impl<T, P> DivAssign<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn div_assign(&mut self, other: T)
[src]
impl<T, P> Encoding for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
const MAX: Self
[src]
const MIN: Self
[src]
const MIN_POSITIVE: Self
[src]
const EPSILON: Self
[src]
fn classify(self) -> FpCategory
[src]
fn is_normal(self) -> bool
[src]
fn is_sign_positive(self) -> bool
[src]
fn is_sign_negative(self) -> bool
[src]
fn integer_decode(self) -> (u64, i16, i8)
[src]
impl<T, P> Eq for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
impl<T, P> Float for ConstrainedFloat<T, P> where
T: Float + ForeignFloat + IntrinsicOrd + Primitive,
P: Constraint<T> + Member<InfiniteClass> + Member<NanClass>,
[src]
T: Float + ForeignFloat + IntrinsicOrd + Primitive,
P: Constraint<T> + Member<InfiniteClass> + Member<NanClass>,
fn infinity() -> Self
[src]
fn neg_infinity() -> Self
[src]
fn is_infinite(self) -> bool
[src]
fn is_finite(self) -> bool
[src]
fn nan() -> Self
[src]
fn is_nan(self) -> bool
[src]
fn max_value() -> Self
[src]
fn min_value() -> Self
[src]
fn min_positive_value() -> Self
[src]
fn epsilon() -> Self
[src]
fn min(self, other: Self) -> Self
[src]
fn max(self, other: Self) -> Self
[src]
fn neg_zero() -> Self
[src]
fn is_sign_positive(self) -> bool
[src]
fn is_sign_negative(self) -> bool
[src]
fn signum(self) -> Self
[src]
fn abs(self) -> Self
[src]
fn classify(self) -> FpCategory
[src]
fn is_normal(self) -> bool
[src]
fn integer_decode(self) -> (u64, i16, i8)
[src]
fn floor(self) -> Self
[src]
fn ceil(self) -> Self
[src]
fn round(self) -> Self
[src]
fn trunc(self) -> Self
[src]
fn fract(self) -> Self
[src]
fn recip(self) -> Self
[src]
fn mul_add(self, a: Self, b: Self) -> Self
[src]
fn abs_sub(self, other: Self) -> Self
[src]
fn powi(self, n: i32) -> Self
[src]
fn powf(self, n: Self) -> Self
[src]
fn sqrt(self) -> Self
[src]
fn cbrt(self) -> Self
[src]
fn exp(self) -> Self
[src]
fn exp2(self) -> Self
[src]
fn exp_m1(self) -> Self
[src]
fn log(self, base: Self) -> Self
[src]
fn ln(self) -> Self
[src]
fn log2(self) -> Self
[src]
fn log10(self) -> Self
[src]
fn ln_1p(self) -> Self
[src]
fn hypot(self, other: Self) -> Self
[src]
fn sin(self) -> Self
[src]
fn cos(self) -> Self
[src]
fn tan(self) -> Self
[src]
fn asin(self) -> Self
[src]
fn acos(self) -> Self
[src]
fn atan(self) -> Self
[src]
fn atan2(self, other: Self) -> Self
[src]
fn sin_cos(self) -> (Self, Self)
[src]
fn sinh(self) -> Self
[src]
fn cosh(self) -> Self
[src]
fn tanh(self) -> Self
[src]
fn asinh(self) -> Self
[src]
fn acosh(self) -> Self
[src]
fn atanh(self) -> Self
[src]
fn to_degrees(self) -> Self
[src]
fn to_radians(self) -> Self
[src]
impl<T, P> FloatConst for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn E() -> Self
[src]
fn PI() -> Self
[src]
fn SQRT_2() -> Self
[src]
fn FRAC_1_PI() -> Self
[src]
fn FRAC_2_PI() -> Self
[src]
fn FRAC_1_SQRT_2() -> Self
[src]
fn FRAC_2_SQRT_PI() -> Self
[src]
fn FRAC_PI_2() -> Self
[src]
fn FRAC_PI_3() -> Self
[src]
fn FRAC_PI_4() -> Self
[src]
fn FRAC_PI_6() -> Self
[src]
fn FRAC_PI_8() -> Self
[src]
fn LN_10() -> Self
[src]
fn LN_2() -> Self
[src]
fn LOG10_E() -> Self
[src]
fn LOG2_E() -> Self
[src]
fn TAU() -> Self where
Self: Add<Self, Output = Self>,
[src]
Self: Add<Self, Output = Self>,
impl<T> From<ConstrainedFloat<T, FiniteConstraint<T>>> for Total<T> where
T: Float + Primitive,
[src]
T: Float + Primitive,
impl<T> From<ConstrainedFloat<T, FiniteConstraint<T>>> for NotNan<T> where
T: Float + Primitive,
[src]
T: Float + Primitive,
impl<T> From<ConstrainedFloat<T, NotNanConstraint<T>>> for Total<T> where
T: Float + Primitive,
[src]
T: Float + Primitive,
impl<P> From<ConstrainedFloat<f32, P>> for f32 where
P: Constraint<f32>,
[src]
P: Constraint<f32>,
fn from(value: ConstrainedFloat<f32, P>) -> Self
[src]
impl<P> From<ConstrainedFloat<f64, P>> for f64 where
P: Constraint<f64>,
[src]
P: Constraint<f64>,
fn from(value: ConstrainedFloat<f64, P>) -> Self
[src]
impl<T, P> From<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
impl<T, P> FromPrimitive for ConstrainedFloat<T, P> where
T: Float + FromPrimitive + Primitive,
P: Constraint<T>,
[src]
T: Float + FromPrimitive + Primitive,
P: Constraint<T>,
fn from_i8(value: i8) -> Option<Self>
[src]
fn from_u8(value: u8) -> Option<Self>
[src]
fn from_i16(value: i16) -> Option<Self>
[src]
fn from_u16(value: u16) -> Option<Self>
[src]
fn from_i32(value: i32) -> Option<Self>
[src]
fn from_u32(value: u32) -> Option<Self>
[src]
fn from_i64(value: i64) -> Option<Self>
[src]
fn from_u64(value: u64) -> Option<Self>
[src]
fn from_isize(value: isize) -> Option<Self>
[src]
fn from_usize(value: usize) -> Option<Self>
[src]
fn from_f32(value: f32) -> Option<Self>
[src]
fn from_f64(value: f64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
impl<T, P> FromStr for ConstrainedFloat<T, P> where
T: Float + FromStr + Primitive,
P: Constraint<T>,
[src]
T: Float + FromStr + Primitive,
P: Constraint<T>,
type Err = <T as FromStr>::Err
The associated error which can be returned from parsing.
fn from_str(string: &str) -> Result<Self, Self::Err>
[src]
impl<T, P> Hash for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T, P> Infinite for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T> + Member<InfiniteClass>,
[src]
T: Float + Primitive,
P: Constraint<T> + Member<InfiniteClass>,
const INFINITY: Self
[src]
const NEG_INFINITY: Self
[src]
fn is_infinite(self) -> bool
[src]
fn is_finite(self) -> bool
[src]
impl<T, P> IntrinsicOrd for ConstrainedFloat<T, P> where
T: Float + IntrinsicOrd + Primitive,
P: Constraint<T>,
[src]
T: Float + IntrinsicOrd + Primitive,
P: Constraint<T>,
fn is_undefined(&self) -> bool
[src]
fn min_max_or_undefined(&self, other: &Self) -> (Self, Self)
[src]
fn min_or_undefined(&self, other: &Self) -> Self
[src]
fn max_or_undefined(&self, other: &Self) -> Self
[src]
impl<T, P> LowerExp for ConstrainedFloat<T, P> where
T: Float + LowerExp + Primitive,
P: Constraint<T>,
[src]
T: Float + LowerExp + Primitive,
P: Constraint<T>,
impl<T, P> Mul<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Self::Output
[src]
impl<T, P> Mul<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: T) -> Self::Output
[src]
impl<T, P> MulAssign<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn mul_assign(&mut self, other: Self)
[src]
impl<T, P> MulAssign<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn mul_assign(&mut self, other: T)
[src]
impl<T, P> Nan for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T> + Member<NanClass>,
[src]
T: Float + Primitive,
P: Constraint<T> + Member<NanClass>,
impl<T, P> Neg for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<T, P> Num for ConstrainedFloat<T, P> where
Self: PartialEq,
T: Float + Primitive,
P: Constraint<T>,
[src]
Self: PartialEq,
T: Float + Primitive,
P: Constraint<T>,
type FromStrRadixErr = ()
fn from_str_radix(
source: &str,
radix: u32
) -> Result<Self, Self::FromStrRadixErr>
[src]
source: &str,
radix: u32
) -> Result<Self, Self::FromStrRadixErr>
impl<T, P> NumCast for ConstrainedFloat<T, P> where
T: Float + NumCast + Primitive + ToPrimitive,
P: Constraint<T>,
[src]
T: Float + NumCast + Primitive + ToPrimitive,
P: Constraint<T>,
fn from<U>(value: U) -> Option<Self> where
U: ToPrimitive,
[src]
U: ToPrimitive,
impl<T, P> One for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn one() -> Self
[src]
fn set_one(&mut self)
[src]
fn is_one(&self) -> bool where
Self: PartialEq<Self>,
[src]
Self: PartialEq<Self>,
impl<T, P> Ord for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T, P> PartialEq<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
impl<T, P> PartialEq<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
impl<T, P> PartialOrd<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T, P> PartialOrd<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn partial_cmp(&self, other: &T) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T, P> Product<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
impl<T, P> Real for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
const E: Self
[src]
const PI: Self
[src]
const FRAC_1_PI: Self
[src]
const FRAC_2_PI: Self
[src]
const FRAC_2_SQRT_PI: Self
[src]
const FRAC_PI_2: Self
[src]
const FRAC_PI_3: Self
[src]
const FRAC_PI_4: Self
[src]
const FRAC_PI_6: Self
[src]
const FRAC_PI_8: Self
[src]
const SQRT_2: Self
[src]
const FRAC_1_SQRT_2: Self
[src]
const LN_2: Self
[src]
const LN_10: Self
[src]
const LOG2_E: Self
[src]
const LOG10_E: Self
[src]
fn floor(self) -> Self
[src]
fn ceil(self) -> Self
[src]
fn round(self) -> Self
[src]
fn trunc(self) -> Self
[src]
fn fract(self) -> Self
[src]
fn recip(self) -> Self
[src]
fn mul_add(self, a: Self, b: Self) -> Self
[src]
fn powi(self, n: i32) -> Self
[src]
fn powf(self, n: Self) -> Self
[src]
fn sqrt(self) -> Self
[src]
fn cbrt(self) -> Self
[src]
fn exp(self) -> Self
[src]
fn exp2(self) -> Self
[src]
fn exp_m1(self) -> Self
[src]
fn log(self, base: Self) -> Self
[src]
fn ln(self) -> Self
[src]
fn log2(self) -> Self
[src]
fn log10(self) -> Self
[src]
fn ln_1p(self) -> Self
[src]
fn hypot(self, other: Self) -> Self
[src]
fn sin(self) -> Self
[src]
fn cos(self) -> Self
[src]
fn tan(self) -> Self
[src]
fn asin(self) -> Self
[src]
fn acos(self) -> Self
[src]
fn atan(self) -> Self
[src]
fn atan2(self, other: Self) -> Self
[src]
fn sin_cos(self) -> (Self, Self)
[src]
fn sinh(self) -> Self
[src]
fn cosh(self) -> Self
[src]
fn tanh(self) -> Self
[src]
fn asinh(self) -> Self
[src]
fn acosh(self) -> Self
[src]
fn atanh(self) -> Self
[src]
impl<T, P> RelativeEq<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive + RelativeEq<Epsilon = T>,
P: Constraint<T>,
[src]
T: Float + Primitive + RelativeEq<Epsilon = T>,
P: Constraint<T>,
fn default_max_relative() -> Self::Epsilon
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
impl<T, P> Rem<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the %
operator.
fn rem(self, other: Self) -> Self::Output
[src]
impl<T, P> Rem<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the %
operator.
fn rem(self, other: T) -> Self::Output
[src]
impl<T, P> RemAssign<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn rem_assign(&mut self, other: Self)
[src]
impl<T, P> RemAssign<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn rem_assign(&mut self, other: T)
[src]
impl<T, P> Serialize for ConstrainedFloat<T, P> where
T: Serialize,
[src]
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<T, P> Signed for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn abs(&self) -> Self
[src]
fn abs_sub(&self, other: &Self) -> Self
[src]
fn signum(&self) -> Self
[src]
fn is_positive(&self) -> bool
[src]
fn is_negative(&self) -> bool
[src]
impl<T, P> Sub<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
impl<T, P> Sub<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: T) -> Self::Output
[src]
impl<T, P> SubAssign<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn sub_assign(&mut self, other: Self)
[src]
impl<T, P> SubAssign<T> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn sub_assign(&mut self, other: T)
[src]
impl<T, P> Sum<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
impl<T, P> ToCanonicalBits for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
fn to_canonical_bits(self) -> u64
[src]
impl<T, P> ToPrimitive for ConstrainedFloat<T, P> where
T: Float + Primitive + ToPrimitive,
P: Constraint<T>,
[src]
T: Float + Primitive + ToPrimitive,
P: Constraint<T>,
fn to_i8(&self) -> Option<i8>
[src]
fn to_u8(&self) -> Option<u8>
[src]
fn to_i16(&self) -> Option<i16>
[src]
fn to_u16(&self) -> Option<u16>
[src]
fn to_i32(&self) -> Option<i32>
[src]
fn to_u32(&self) -> Option<u32>
[src]
fn to_i64(&self) -> Option<i64>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_isize(&self) -> Option<isize>
[src]
fn to_usize(&self) -> Option<usize>
[src]
fn to_f32(&self) -> Option<f32>
[src]
fn to_f64(&self) -> Option<f64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u128(&self) -> Option<u128>
[src]
impl<T, P> UlpsEq<ConstrainedFloat<T, P>> for ConstrainedFloat<T, P> where
T: Float + Primitive + UlpsEq<Epsilon = T>,
P: Constraint<T>,
[src]
T: Float + Primitive + UlpsEq<Epsilon = T>,
P: Constraint<T>,
fn default_max_ulps() -> u32
[src]
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
impl<T, P> UpperExp for ConstrainedFloat<T, P> where
T: Float + Primitive + UpperExp,
P: Constraint<T>,
[src]
T: Float + Primitive + UpperExp,
P: Constraint<T>,
impl<T, P> Zero for ConstrainedFloat<T, P> where
T: Float + Primitive,
P: Constraint<T>,
[src]
T: Float + Primitive,
P: Constraint<T>,
Auto Trait Implementations
impl<T, P> RefUnwindSafe for ConstrainedFloat<T, P> where
P: RefUnwindSafe,
T: RefUnwindSafe,
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> Send for ConstrainedFloat<T, P> where
P: Send,
T: Send,
P: Send,
T: Send,
impl<T, P> Sync for ConstrainedFloat<T, P> where
P: Sync,
T: Sync,
P: Sync,
T: Sync,
impl<T, P> Unpin for ConstrainedFloat<T, P> where
P: Unpin,
T: Unpin,
P: Unpin,
T: Unpin,
impl<T, P> UnwindSafe for ConstrainedFloat<T, P> where
P: UnwindSafe,
T: UnwindSafe,
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Float for T where
T: Encoding + Infinite + IntrinsicOrd + Nan + Real,
[src]
T: Encoding + Infinite + IntrinsicOrd + Nan + Real,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> NumAssign for T where
T: Num + NumAssignOps<T>,
[src]
T: Num + NumAssignOps<T>,
impl<T, Rhs> NumAssignOps<Rhs> for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
[src]
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T> Real for T where
T: Float,
[src]
T: Float,
fn min_value() -> T
[src]
fn min_positive_value() -> T
[src]
fn epsilon() -> T
[src]
fn max_value() -> T
[src]
fn floor(self) -> T
[src]
fn ceil(self) -> T
[src]
fn round(self) -> T
[src]
fn trunc(self) -> T
[src]
fn fract(self) -> T
[src]
fn abs(self) -> T
[src]
fn signum(self) -> T
[src]
fn is_sign_positive(self) -> bool
[src]
fn is_sign_negative(self) -> bool
[src]
fn mul_add(self, a: T, b: T) -> T
[src]
fn recip(self) -> T
[src]
fn powi(self, n: i32) -> T
[src]
fn powf(self, n: T) -> T
[src]
fn sqrt(self) -> T
[src]
fn exp(self) -> T
[src]
fn exp2(self) -> T
[src]
fn ln(self) -> T
[src]
fn log(self, base: T) -> T
[src]
fn log2(self) -> T
[src]
fn log10(self) -> T
[src]
fn to_degrees(self) -> T
[src]
fn to_radians(self) -> T
[src]
fn max(self, other: T) -> T
[src]
fn min(self, other: T) -> T
[src]
fn abs_sub(self, other: T) -> T
[src]
fn cbrt(self) -> T
[src]
fn hypot(self, other: T) -> T
[src]
fn sin(self) -> T
[src]
fn cos(self) -> T
[src]
fn tan(self) -> T
[src]
fn asin(self) -> T
[src]
fn acos(self) -> T
[src]
fn atan(self) -> T
[src]
fn atan2(self, other: T) -> T
[src]
fn sin_cos(self) -> (T, T)
[src]
fn exp_m1(self) -> T
[src]
fn ln_1p(self) -> T
[src]
fn sinh(self) -> T
[src]
fn cosh(self) -> T
[src]
fn tanh(self) -> T
[src]
fn asinh(self) -> T
[src]
fn acosh(self) -> T
[src]
fn atanh(self) -> T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,