pub struct Constrained<T, C> { /* private fields */ }Expand description
IEEE 754 floating-point proxy that provides total ordering, equivalence, hashing, constraints, and error handling.
Constrained types wrap primitive floating-point type and extend their behavior. For example,
all proxy types implement the standard Eq, Hash, and Ord traits, sometimes via the
non-standard relations described in the cmp module when NaNs must be considered.
Constraints and divergence can be composed to determine the subset of floating-point values
that a proxy supports and how the proxy behaves when those constraints are violated.
Various type definitions are provided for various useful proxy constructions, such as the
Total type, which extends floating-point types with a non-standard total ordering.
Implementations§
Source§impl<T, C> Constrained<T, C>where
T: Copy,
impl<T, C> Constrained<T, C>where
T: Copy,
Sourcepub const fn into_inner(self) -> T
pub const fn into_inner(self) -> T
Converts a proxy into its underlying primitive floating-point type.
§Examples
use decorum::R64;
fn f() -> R64 {
// ...
}
let x: f64 = f().into_inner();
// The standard `From` and `Into` traits can also be used.
let y: f64 = f().into();Source§impl<T, C> Constrained<T, C>where
T: Debug,
C: StaticDebug,
impl<T, C> Constrained<T, C>where
T: Debug,
C: StaticDebug,
Sourcepub const fn debug(&self) -> impl '_ + Copy + Debug
pub const fn debug(&self) -> impl '_ + Copy + Debug
Gets a Debug implementation that thoroughly describes the proxy.
Constrained types implement Display and Debug, but these implementations omit
more specific information about constraints and divergence. This function
provides an instance of a verbose Debug type that more thoroughly describes the
behavior of the proxy.
Source§impl<T, C> Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Constrained<T, C>where
T: Primitive,
C: Constraint,
Sourcepub fn new(inner: T) -> OutputFor<Self>
pub fn new(inner: T) -> OutputFor<Self>
Constructs a proxy from a primitive IEEE 754 floating-point value.
This function returns the output type of the divergence of the proxy and invokes its
error behavior if the floating-point value does not satisfy constraints. Note that this
function never fails for Total, which has no constraints.
The distinctions in output and behavior are static and are determined by the type
parameters of the Constrained type constructor.
§Panics
This function panics if the primitive floating-point value does not satisfy the constraints
of the proxy and the divergence of the proxy panics. For example, the OrPanic
divergence asserts constraints and panics.
§Errors
Returns an error if the primitive floating-point value does not satisfy the constraints of
the proxy and the divergence of the proxy encodes errors in its output type. For
example, the output type of the OrError<AsExpression> divergence is Expression and
this function returns the Undefined variant if the constraint is violated.
§Examples
Fallibly constructing proxies from primitive floating-point values:
use decorum::constraint::IsReal;
use decorum::divergence::{AsResult, OrError};
use decorum::proxy::Constrained;
// The output type of `Real` is `Result`.
type Real = Constrained<f64, IsReal<OrError<AsResult>>>;
let x = Real::new(2.0).unwrap(); // The output type of `new` is `Result` per `TryResult`.Asserting proxy construction from primitive floating-point values:
use decorum::constraint::IsReal;
use decorum::divergence::OrPanic;
use decorum::proxy::Constrained;
// The output type of `OrPanic` is `Real`.
type Real = Constrained<f64, IsReal<OrPanic>>;
let x = Real::new(2.0); // The output type of `new` is `Real` per `OrPanic`.
let y = Real::new(0.0 / 0.0); // Panics.Sourcepub fn try_new(inner: T) -> Result<Self, C::Error>
pub fn try_new(inner: T) -> Result<Self, C::Error>
Fallibly constructs a proxy from a primitive IEEE 754 floating-point value.
This construction mirrors the TryFrom implementation and is independent of the
divergence of the proxy; it always outputs a Result and never panics.
§Errors
Returns an error if the primitive floating-point value does not satisfy the constraints of
the proxy. Note that the error type of the IsFloat constraint is Infallible and the
construction of Totals cannot fail here.
§Examples
Constructing proxies from primitive floating-point values:
use decorum::constraint::IsReal;
use decorum::divergence::OrPanic;
use decorum::proxy::Constrained;
type Real = Constrained<f64, IsReal<OrPanic>>;
fn f(x: Real) -> Real {
x * 2.0
}
let y = f(Real::try_new(2.0).unwrap());
// The `TryFrom` and `TryInto` traits can also be used.
let z = f(2.0.try_into().unwrap());A proxy construction that fails:
use decorum::constraint::IsReal;
use decorum::divergence::OrPanic;
use decorum::proxy::Constrained;
type Real = Constrained<f64, IsReal<OrPanic>>;
// `IsReal` does not allow `NaN`s, but `0.0 / 0.0` produces a `NaN`.
let x = Real::try_new(0.0 / 0.0).unwrap(); // Panics when unwrapping.Sourcepub fn assert(inner: T) -> Self
pub fn assert(inner: T) -> Self
Constructs a proxy from a primitive IEEE 754 floating-point value and asserts that its constraints are satisfied.
This construction is independent of the divergence of the proxy and always asserts
constraints (even when the divergence is fallible). Note that this function never fails
(panics) for Total, which has no constraints.
§Panics
This construction panics if the primitive floating-point value does not satisfy the constraints of the proxy.
§Examples
Constructing proxies from primitive floating-point values:
use decorum::constraint::IsReal;
use decorum::divergence::OrPanic;
use decorum::proxy::Constrained;
type Real = Constrained<f64, IsReal<OrPanic>>;
fn f(x: Real) -> Real {
x * 2.0
}
let y = f(Real::assert(2.0));A proxy construction that fails:
use decorum::constraint::IsReal;
use decorum::divergence::OrPanic;
use decorum::proxy::Constrained;
type Real = Constrained<f64, IsReal<OrPanic>>;
// `IsReal` does not allow `NaN`s, but `0.0 / 0.0` produces a `NaN`.
let x = Real::assert(0.0 / 0.0); // Panics.Sourcepub fn try_from_slice<'a>(slice: &'a [T]) -> Result<&'a [Self], C::Error>
pub fn try_from_slice<'a>(slice: &'a [T]) -> Result<&'a [Self], C::Error>
Converts a slice of primitive IEEE 754 floating-point values into a slice of proxies.
This conversion must check the constraints of the proxy against each floating-point value
and so has O(N) time complexity. When using the IsFloat constraint, prefer the
infallible and O(1) from_slice function.
§Errors
Returns an error if any of the primitive floating-point values in the slice do not satisfy the constraints of the proxy.
Sourcepub fn try_from_mut_slice<'a>(
slice: &'a mut [T],
) -> Result<&'a mut [Self], C::Error>
pub fn try_from_mut_slice<'a>( slice: &'a mut [T], ) -> Result<&'a mut [Self], C::Error>
Converts a mutable slice of primitive IEEE 754 floating-point values into a mutable slice of proxies.
This conversion must check the constraints of the proxy against each floating-point value
and so has O(N) time complexity. When using the IsFloat constraint, prefer the
infallible and O(1) from_mut_slice function.
§Errors
Returns an error if any of the primitive floating-point values in the slice do not satisfy the constraints of the proxy.
Sourcepub fn from_subset<C2>(other: Constrained<T, C2>) -> Selfwhere
C2: Constraint + SubsetOf<C>,
pub fn from_subset<C2>(other: Constrained<T, C2>) -> Selfwhere
C2: Constraint + SubsetOf<C>,
Converts a proxy into another proxy that is capable of representing a superset of its values per its constraint.
§Examples
use decorum::divergence::OrPanic;
use decorum::real::UnaryRealFunction;
use decorum::{E64, R64};
let x = R64::<OrPanic>::ZERO;
let y = E64::from_subset(x); // `E64` allows a superset of the values of `R64`.Sourcepub fn into_superset<C2>(self) -> Constrained<T, C2>where
C2: Constraint + SupersetOf<C>,
pub fn into_superset<C2>(self) -> Constrained<T, C2>where
C2: Constraint + SupersetOf<C>,
Converts a proxy into another proxy that is capable of representing a superset of its values per its constraint.
§Examples
use decorum::real::UnaryRealFunction;
use decorum::{E64, R64};
let x = R64::ZERO;
let y: E64 = x.into_superset(); // `E64` allows a superset of the values of `R64`.Sourcepub fn into_expression(self) -> ExpressionFor<Self>
pub fn into_expression(self) -> ExpressionFor<Self>
Converts a proxy into its corresponding Expression.
The output of this function is always the Defined variant.
Source§impl<T> Constrained<T, IsFloat>where
T: Primitive,
impl<T> Constrained<T, IsFloat>where
T: Primitive,
Sourcepub fn from_slice<'a>(slice: &'a [T]) -> &'a [Self]
pub fn from_slice<'a>(slice: &'a [T]) -> &'a [Self]
Converts a slice of primitive IEEE 754 floating-point values into a slice of Totals.
Unlike try_from_slice, this conversion is infallible and trivial and so has O(1) time
complexity.
Sourcepub fn from_mut_slice<'a>(slice: &'a mut [T]) -> &'a mut [Self]
pub fn from_mut_slice<'a>(slice: &'a mut [T]) -> &'a mut [Self]
Converts a mutable slice of primitive floating-point values into a mutable slice of
Totals.
Unlike try_from_mut_slice, this conversion is infallible and trivial and so has O(1)
time complexity.
Trait Implementations§
Source§impl<T, C> AbsDiffEq for Constrained<T, C>
impl<T, C> AbsDiffEq for Constrained<T, C>
Source§type Epsilon = Constrained<T, C>
type Epsilon = Constrained<T, C>
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq.Source§impl<T, C> Add<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>
impl<T, C> Add<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>
Source§type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
+ operator.Source§impl<C> Add<Constrained<f32, C>> for f32where
C: Constraint,
impl<C> Add<Constrained<f32, C>> for f32where
C: Constraint,
Source§type Output = <<<<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f32, C>, <<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f32, C>, <<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
+ operator.Source§impl<C> Add<Constrained<f64, C>> for f64where
C: Constraint,
impl<C> Add<Constrained<f64, C>> for f64where
C: Constraint,
Source§type Output = <<<<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f64, C>, <<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f64, C>, <<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
+ operator.Source§impl<T, C> Add<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>
impl<T, C> Add<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>
Source§type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
+ operator.Source§impl<T, C> Add<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Add<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
+ operator.Source§impl<T, C> Add for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Add for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
+ operator.Source§impl<T, C, E> AddAssign<T> for Constrained<T, C>
impl<T, C, E> AddAssign<T> for Constrained<T, C>
Source§fn add_assign(&mut self, other: T)
fn add_assign(&mut self, other: T)
+= operation. Read moreSource§impl<T, C, E> AddAssign for Constrained<T, C>
impl<T, C, E> AddAssign for Constrained<T, C>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+= operation. Read moreSource§impl<T, C> AsRef<T> for Constrained<T, C>
impl<T, C> AsRef<T> for Constrained<T, C>
Source§impl<T, C> BaseEncoding for Constrained<T, C>where
T: Primitive,
impl<T, C> BaseEncoding for Constrained<T, C>where
T: Primitive,
const MAX_FINITE: Self
const MIN_FINITE: Self
const MIN_POSITIVE_NORMAL: Self
const EPSILON: Self
fn classify(self) -> FpCategory
fn is_normal(self) -> bool
fn is_sign_positive(self) -> bool
fn is_sign_negative(self) -> bool
fn signum(self) -> Self
fn integer_decode(self) -> (u64, i16, i8)
Source§impl<T, C> BinaryRealFunction<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>where
ErrorFor<Constrained<T, C>>: Clone + EmptyInhabitant,
T: Primitive,
C: Constraint,
C::Divergence: Divergence<Continue = AsExpression>,
impl<T, C> BinaryRealFunction<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>where
ErrorFor<Constrained<T, C>>: Clone + EmptyInhabitant,
T: Primitive,
C: Constraint,
C::Divergence: Divergence<Continue = AsExpression>,
fn div_euclid(self, n: Constrained<T, C>) -> Self::Codomain
fn rem_euclid(self, n: Constrained<T, C>) -> Self::Codomain
fn pow(self, n: Constrained<T, C>) -> Self::Codomain
fn log(self, base: Constrained<T, C>) -> Self::Codomain
fn hypot(self, other: Constrained<T, C>) -> Self::Codomain
fn atan2(self, other: Constrained<T, C>) -> Self::Codomain
Source§impl<T, C> BinaryRealFunction<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>where
ErrorFor<Constrained<T, C>>: Clone + EmptyInhabitant,
T: Primitive,
C: Constraint,
C::Divergence: Divergence<Continue = AsExpression>,
impl<T, C> BinaryRealFunction<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>where
ErrorFor<Constrained<T, C>>: Clone + EmptyInhabitant,
T: Primitive,
C: Constraint,
C::Divergence: Divergence<Continue = AsExpression>,
fn div_euclid(self, n: ExpressionFor<Constrained<T, C>>) -> Self::Codomain
fn rem_euclid(self, n: ExpressionFor<Constrained<T, C>>) -> Self::Codomain
fn pow(self, n: ExpressionFor<Constrained<T, C>>) -> Self::Codomain
fn log(self, base: ExpressionFor<Constrained<T, C>>) -> Self::Codomain
fn hypot(self, other: ExpressionFor<Constrained<T, C>>) -> Self::Codomain
fn atan2(self, other: ExpressionFor<Constrained<T, C>>) -> Self::Codomain
Source§impl<T, C> BinaryRealFunction<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> BinaryRealFunction<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§impl<T, C> BinaryRealFunction for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> BinaryRealFunction for Constrained<T, C>where
T: Primitive,
C: Constraint,
fn div_euclid(self, n: Self) -> Self::Codomain
fn rem_euclid(self, n: Self) -> Self::Codomain
fn pow(self, n: Self) -> Self::Codomain
fn log(self, base: Self) -> Self::Codomain
fn hypot(self, other: Self) -> Self::Codomain
fn atan2(self, other: Self) -> Self::Codomain
Source§impl<T, C> Bounded for Constrained<T, C>where
T: Primitive,
impl<T, C> Bounded for Constrained<T, C>where
T: Primitive,
Source§impl<T, C> Clone for Constrained<T, C>where
T: Clone,
impl<T, C> Clone for Constrained<T, C>where
T: Clone,
Source§impl<T, C> ConstrainedProxy for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> ConstrainedProxy for Constrained<T, C>where
T: Primitive,
C: Constraint,
type Constraint = C
Source§impl<T, D> Debug for Constrained<T, IsExtendedReal<D>>where
T: Debug,
D: Divergence,
impl<T, D> Debug for Constrained<T, IsExtendedReal<D>>where
T: Debug,
D: Divergence,
Source§impl<T, D> Debug for Constrained<T, IsReal<D>>where
T: Debug,
D: Divergence,
impl<T, D> Debug for Constrained<T, IsReal<D>>where
T: Debug,
D: Divergence,
Source§impl<T, C> Default for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Default for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§impl<'de, T, C> Deserialize<'de> for Constrained<T, C>
impl<'de, T, C> Deserialize<'de> for Constrained<T, C>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<T, C> Display for Constrained<T, C>where
T: Display,
impl<T, C> Display for Constrained<T, C>where
T: Display,
Source§impl<T, C> Div<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>
impl<T, C> Div<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>
Source§type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
/ operator.Source§impl<C> Div<Constrained<f32, C>> for f32where
C: Constraint,
impl<C> Div<Constrained<f32, C>> for f32where
C: Constraint,
Source§type Output = <<<<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f32, C>, <<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f32, C>, <<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
/ operator.Source§impl<C> Div<Constrained<f64, C>> for f64where
C: Constraint,
impl<C> Div<Constrained<f64, C>> for f64where
C: Constraint,
Source§type Output = <<<<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f64, C>, <<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f64, C>, <<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
/ operator.Source§impl<T, C> Div<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>
impl<T, C> Div<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>
Source§type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
/ operator.Source§impl<T, C> Div<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Div<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
/ operator.Source§impl<T, C> Div for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Div for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
/ operator.Source§impl<T, C, E> DivAssign<T> for Constrained<T, C>
impl<T, C, E> DivAssign<T> for Constrained<T, C>
Source§fn div_assign(&mut self, other: T)
fn div_assign(&mut self, other: T)
/= operation. Read moreSource§impl<T, C, E> DivAssign for Constrained<T, C>
impl<T, C, E> DivAssign for Constrained<T, C>
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
/= operation. Read moreSource§impl<T, C> EmptyOrd for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> EmptyOrd for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§impl<T, C, E> Float for Constrained<T, C>where
T: Float + Primitive,
C: Constraint<Error = E> + Member<InfinitySet> + Member<NanSet>,
ContinueFor<C::Divergence>: NonResidual<Self, E>,
impl<T, C, E> Float for Constrained<T, C>where
T: Float + Primitive,
C: Constraint<Error = E> + Member<InfinitySet> + Member<NanSet>,
ContinueFor<C::Divergence>: NonResidual<Self, E>,
Source§fn neg_infinity() -> Self
fn neg_infinity() -> Self
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 max_value() -> Self
fn max_value() -> Self
Source§fn min_value() -> Self
fn min_value() -> Self
Source§fn min_positive_value() -> Self
fn min_positive_value() -> Self
Source§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 integer_decode(self) -> (u64, i16, i8)
fn integer_decode(self) -> (u64, i16, i8)
sign * mantissa * 2 ^ exponent. Read moreSource§fn ceil(self) -> Self
fn ceil(self) -> Self
Source§fn round(self) -> Self
fn round(self) -> Self
0.0. Read moreSource§fn mul_add(self, a: Self, b: Self) -> Self
fn mul_add(self, a: Self, b: Self) -> Self
(self * a) + b with only one rounding
error, yielding a more accurate result than an unfused multiply-add. Read moreSource§fn exp_m1(self) -> Self
fn exp_m1(self) -> Self
e^(self) - 1 in a way that is accurate even if the
number is close to zero. Read moreSource§fn log(self, base: Self) -> Self
fn log(self, base: Self) -> Self
Source§fn ln_1p(self) -> Self
fn ln_1p(self) -> Self
ln(1+n) (natural logarithm) more accurately than if
the operations were performed separately. Read moreSource§fn hypot(self, other: Self) -> Self
fn hypot(self, other: Self) -> Self
x and y. Read moreSource§fn asin(self) -> Self
fn asin(self) -> Self
Source§fn acos(self) -> Self
fn acos(self) -> Self
Source§fn atan(self) -> Self
fn atan(self) -> Self
Source§fn to_degrees(self) -> Self
fn to_degrees(self) -> Self
Source§fn to_radians(self) -> Self
fn to_radians(self) -> Self
Source§impl<T, C> FloatConst for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> FloatConst for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§fn FRAC_1_SQRT_2() -> Self
fn FRAC_1_SQRT_2() -> Self
1.0 / sqrt(2.0).Source§fn FRAC_2_SQRT_PI() -> Self
fn FRAC_2_SQRT_PI() -> Self
2.0 / sqrt(π).Source§impl<T, C> From<Constrained<T, C>> for Expression<Constrained<T, C>, ErrorFor<Constrained<T, C>>>where
T: Primitive,
C: Constraint,
impl<T, C> From<Constrained<T, C>> for Expression<Constrained<T, C>, ErrorFor<Constrained<T, C>>>where
T: Primitive,
C: Constraint,
Source§fn from(proxy: Constrained<T, C>) -> Self
fn from(proxy: Constrained<T, C>) -> Self
Source§impl<T> From<Constrained<T, IsExtendedReal<OrPanic>>> for Total<T>where
T: Primitive,
impl<T> From<Constrained<T, IsExtendedReal<OrPanic>>> for Total<T>where
T: Primitive,
Source§fn from(other: ExtendedReal<T>) -> Self
fn from(other: ExtendedReal<T>) -> Self
Source§impl<T> From<Constrained<T, IsReal<OrPanic>>> for ExtendedReal<T>where
T: Primitive,
impl<T> From<Constrained<T, IsReal<OrPanic>>> for ExtendedReal<T>where
T: Primitive,
Source§impl<C> From<Constrained<f32, C>> for f32
impl<C> From<Constrained<f32, C>> for f32
Source§fn from(proxy: Constrained<f32, C>) -> Self
fn from(proxy: Constrained<f32, C>) -> Self
Source§impl<C> From<Constrained<f64, C>> for f64
impl<C> From<Constrained<f64, C>> for f64
Source§fn from(proxy: Constrained<f64, C>) -> Self
fn from(proxy: Constrained<f64, C>) -> Self
Source§impl<T, C> FromPrimitive for Constrained<T, C>
impl<T, C> FromPrimitive for Constrained<T, C>
Source§fn from_i8(value: i8) -> Option<Self>
fn from_i8(value: i8) -> Option<Self>
i8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u8(value: u8) -> Option<Self>
fn from_u8(value: u8) -> Option<Self>
u8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i16(value: i16) -> Option<Self>
fn from_i16(value: i16) -> Option<Self>
i16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u16(value: u16) -> Option<Self>
fn from_u16(value: u16) -> Option<Self>
u16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i32(value: i32) -> Option<Self>
fn from_i32(value: i32) -> Option<Self>
i32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u32(value: u32) -> Option<Self>
fn from_u32(value: u32) -> Option<Self>
u32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i64(value: i64) -> Option<Self>
fn from_i64(value: i64) -> Option<Self>
i64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u64(value: u64) -> Option<Self>
fn from_u64(value: u64) -> Option<Self>
u64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_isize(value: isize) -> Option<Self>
fn from_isize(value: isize) -> Option<Self>
isize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_usize(value: usize) -> Option<Self>
fn from_usize(value: usize) -> Option<Self>
usize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_f32(value: f32) -> Option<Self>
fn from_f32(value: f32) -> Option<Self>
f32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_f64(value: f64) -> Option<Self>
fn from_f64(value: f64) -> Option<Self>
f64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§impl<T, C, E> FromStr for Constrained<T, C>where
T: FromStr + Primitive,
C: Constraint<Error = E>,
ContinueFor<C::Divergence>: NonResidual<Self, E>,
impl<T, C, E> FromStr for Constrained<T, C>where
T: FromStr + Primitive,
C: Constraint<Error = E>,
ContinueFor<C::Divergence>: NonResidual<Self, E>,
Source§impl<T, C> Function for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Function for Constrained<T, C>where
T: Primitive,
C: Constraint,
type Codomain = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
Source§impl<T, C> Hash for Constrained<T, C>where
T: Primitive + ToCanonical,
impl<T, C> Hash for Constrained<T, C>where
T: Primitive + ToCanonical,
Source§impl<T, C> InfinityEncoding for Constrained<T, C>
impl<T, C> InfinityEncoding for Constrained<T, C>
Source§impl<T, C> LowerExp for Constrained<T, C>
impl<T, C> LowerExp for Constrained<T, C>
Source§impl<T, C> Mul<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>
impl<T, C> Mul<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>
Source§type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
* operator.Source§impl<C> Mul<Constrained<f32, C>> for f32where
C: Constraint,
impl<C> Mul<Constrained<f32, C>> for f32where
C: Constraint,
Source§type Output = <<<<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f32, C>, <<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f32, C>, <<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
* operator.Source§impl<C> Mul<Constrained<f64, C>> for f64where
C: Constraint,
impl<C> Mul<Constrained<f64, C>> for f64where
C: Constraint,
Source§type Output = <<<<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f64, C>, <<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f64, C>, <<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
* operator.Source§impl<T, C> Mul<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>
impl<T, C> Mul<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>
Source§type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
* operator.Source§impl<T, C> Mul<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Mul<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
* operator.Source§impl<T, C> Mul for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Mul for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
* operator.Source§impl<T, C, E> MulAssign<T> for Constrained<T, C>
impl<T, C, E> MulAssign<T> for Constrained<T, C>
Source§fn mul_assign(&mut self, other: T)
fn mul_assign(&mut self, other: T)
*= operation. Read moreSource§impl<T, C, E> MulAssign for Constrained<T, C>
impl<T, C, E> MulAssign for Constrained<T, C>
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
*= operation. Read moreSource§impl<T, C> NanEncoding for Constrained<T, C>
impl<T, C> NanEncoding for Constrained<T, C>
Source§impl<T, C> Neg for Constrained<T, C>where
T: Primitive,
impl<T, C> Neg for Constrained<T, C>where
T: Primitive,
Source§impl<T, C, E> Num for Constrained<T, C>where
T: Num + Primitive,
C: Constraint<Error = E>,
ContinueFor<C::Divergence>: NonResidual<Self, E>,
impl<T, C, E> Num for Constrained<T, C>where
T: Num + Primitive,
C: Constraint<Error = E>,
ContinueFor<C::Divergence>: NonResidual<Self, E>,
type FromStrRadixErr = ()
Source§fn from_str_radix(
source: &str,
radix: u32,
) -> Result<Self, Self::FromStrRadixErr>
fn from_str_radix( source: &str, radix: u32, ) -> Result<Self, Self::FromStrRadixErr>
2..=36). Read moreSource§impl<T, C> NumCast for Constrained<T, C>
impl<T, C> NumCast for Constrained<T, C>
Source§impl<T, C, E> One for Constrained<T, C>
impl<T, C, E> One for Constrained<T, C>
Source§impl<T, C> Ord for Constrained<T, C>where
T: Primitive,
impl<T, C> Ord for Constrained<T, C>where
T: Primitive,
Source§impl<T, C> PartialEq<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> PartialEq<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§impl<T, C> PartialEq for Constrained<T, C>where
T: Primitive,
impl<T, C> PartialEq for Constrained<T, C>where
T: Primitive,
Source§impl<T, C> PartialOrd<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> PartialOrd<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§impl<T, C> PartialOrd for Constrained<T, C>where
T: Primitive,
impl<T, C> PartialOrd for Constrained<T, C>where
T: Primitive,
Source§impl<T, C, E> Product for Constrained<T, C>
impl<T, C, E> Product for Constrained<T, C>
Source§impl<T, C> RelativeEq for Constrained<T, C>
impl<T, C> RelativeEq for Constrained<T, C>
Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
Source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq.Source§impl<T, C> Rem<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>
impl<T, C> Rem<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>
Source§type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
% operator.Source§impl<C> Rem<Constrained<f32, C>> for f32where
C: Constraint,
impl<C> Rem<Constrained<f32, C>> for f32where
C: Constraint,
Source§type Output = <<<<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f32, C>, <<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f32, C>, <<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
% operator.Source§impl<C> Rem<Constrained<f64, C>> for f64where
C: Constraint,
impl<C> Rem<Constrained<f64, C>> for f64where
C: Constraint,
Source§type Output = <<<<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f64, C>, <<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f64, C>, <<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
% operator.Source§impl<T, C> Rem<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>
impl<T, C> Rem<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>
Source§type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
% operator.Source§impl<T, C> Rem<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Rem<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
% operator.Source§impl<T, C> Rem for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Rem for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
% operator.Source§impl<T, C, E> RemAssign<T> for Constrained<T, C>
impl<T, C, E> RemAssign<T> for Constrained<T, C>
Source§fn rem_assign(&mut self, other: T)
fn rem_assign(&mut self, other: T)
%= operation. Read moreSource§impl<T, C, E> RemAssign for Constrained<T, C>
impl<T, C, E> RemAssign for Constrained<T, C>
Source§fn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
%= operation. Read moreSource§impl<T, C> Serialize for Constrained<T, C>
impl<T, C> Serialize for Constrained<T, C>
Source§impl<T, C, E> Signed for Constrained<T, C>where
T: Primitive + Signed,
C: Constraint<Error = E>,
ContinueFor<C::Divergence>: NonResidual<Self, E>,
impl<T, C, E> Signed for Constrained<T, C>where
T: Primitive + Signed,
C: Constraint<Error = E>,
ContinueFor<C::Divergence>: NonResidual<Self, E>,
Source§fn is_positive(&self) -> bool
fn is_positive(&self) -> bool
Source§fn is_negative(&self) -> bool
fn is_negative(&self) -> bool
Source§impl<T, C> Sub<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>
impl<T, C> Sub<Constrained<T, C>> for ExpressionFor<Constrained<T, C>>
Source§type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
- operator.Source§impl<C> Sub<Constrained<f32, C>> for f32where
C: Constraint,
impl<C> Sub<Constrained<f32, C>> for f32where
C: Constraint,
Source§type Output = <<<<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f32, C>, <<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f32, C>, <<Constrained<f32, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
- operator.Source§impl<C> Sub<Constrained<f64, C>> for f64where
C: Constraint,
impl<C> Sub<Constrained<f64, C>> for f64where
C: Constraint,
Source§type Output = <<<<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f64, C>, <<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<f64, C>, <<Constrained<f64, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
- operator.Source§impl<T, C> Sub<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>
impl<T, C> Sub<Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>> for Constrained<T, C>
Source§type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = Expression<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
- operator.Source§impl<T, C> Sub<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Sub<T> for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
- operator.Source§impl<T, C> Sub for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> Sub for Constrained<T, C>where
T: Primitive,
C: Constraint,
Source§type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
type Output = <<<<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Divergence as Divergence>::Continue as Continue>::As<Constrained<T, C>, <<Constrained<T, C> as ConstrainedProxy>::Constraint as Constraint>::Error>
- operator.Source§impl<T, C, E> SubAssign<T> for Constrained<T, C>
impl<T, C, E> SubAssign<T> for Constrained<T, C>
Source§fn sub_assign(&mut self, other: T)
fn sub_assign(&mut self, other: T)
-= operation. Read moreSource§impl<T, C, E> SubAssign for Constrained<T, C>
impl<T, C, E> SubAssign for Constrained<T, C>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-= operation. Read moreSource§impl<T, C, E> Sum for Constrained<T, C>
impl<T, C, E> Sum for Constrained<T, C>
Source§impl<T, C> ToCanonical for Constrained<T, C>where
T: Primitive,
impl<T, C> ToCanonical for Constrained<T, C>where
T: Primitive,
type Canonical = <T as ToCanonical>::Canonical
Source§fn to_canonical(self) -> Self::Canonical
fn to_canonical(self) -> Self::Canonical
Source§impl<T, C> ToPrimitive for Constrained<T, C>where
T: Primitive + ToPrimitive,
impl<T, C> ToPrimitive for Constrained<T, C>where
T: Primitive + ToPrimitive,
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_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_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_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_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_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_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_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_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_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_f32(&self) -> Option<f32>
fn to_f32(&self) -> Option<f32>
self to an f32. Overflows may map to positive
or negative inifinity, otherwise None is returned if the value cannot
be represented by an f32.Source§fn to_f64(&self) -> Option<f64>
fn to_f64(&self) -> Option<f64>
self to an f64. Overflows may map to positive
or negative inifinity, otherwise None is returned if the value cannot
be represented by an f64. Read moreSource§impl<C> TryFrom<Expression<Constrained<f32, C>, <C as Constraint>::Error>> for Constrained<f32, C>where
C: Constraint,
impl<C> TryFrom<Expression<Constrained<f32, C>, <C as Constraint>::Error>> for Constrained<f32, C>where
C: Constraint,
Source§type Error = <C as Constraint>::Error
type Error = <C as Constraint>::Error
Source§fn try_from(
expression: Expression<Constrained<f32, C>, C::Error>,
) -> Result<Self, Self::Error>
fn try_from( expression: Expression<Constrained<f32, C>, C::Error>, ) -> Result<Self, Self::Error>
Source§impl<C> TryFrom<Expression<Constrained<f64, C>, <C as Constraint>::Error>> for Constrained<f64, C>where
C: Constraint,
impl<C> TryFrom<Expression<Constrained<f64, C>, <C as Constraint>::Error>> for Constrained<f64, C>where
C: Constraint,
Source§type Error = <C as Constraint>::Error
type Error = <C as Constraint>::Error
Source§fn try_from(
expression: Expression<Constrained<f64, C>, C::Error>,
) -> Result<Self, Self::Error>
fn try_from( expression: Expression<Constrained<f64, C>, C::Error>, ) -> Result<Self, Self::Error>
Source§impl<T, C> UlpsEq for Constrained<T, C>
impl<T, C> UlpsEq for Constrained<T, C>
Source§impl<T, C> UnaryRealFunction for Constrained<T, C>where
T: Primitive,
C: Constraint,
impl<T, C> UnaryRealFunction for Constrained<T, C>where
T: Primitive,
C: Constraint,
const ZERO: Self
const ONE: Self
const E: Self
const PI: Self
const FRAC_1_PI: Self
const FRAC_2_PI: Self
const FRAC_2_SQRT_PI: Self
const FRAC_PI_2: Self
const FRAC_PI_3: Self
const FRAC_PI_4: Self
const FRAC_PI_6: Self
const FRAC_PI_8: Self
const SQRT_2: Self
const FRAC_1_SQRT_2: Self
const LN_2: Self
const LN_10: Self
const LOG2_E: Self
const LOG10_E: Self
fn is_zero(self) -> bool
fn is_one(self) -> bool
fn sign(self) -> Sign
fn abs(self) -> Self
fn floor(self) -> Self
fn ceil(self) -> Self
fn round(self) -> Self
fn trunc(self) -> Self
fn fract(self) -> Self
fn recip(self) -> Self::Codomain
fn powi(self, n: i32) -> Self::Codomain
fn sqrt(self) -> Self::Codomain
fn cbrt(self) -> Self
fn exp(self) -> Self::Codomain
fn exp2(self) -> Self::Codomain
fn exp_m1(self) -> Self::Codomain
fn ln(self) -> Self::Codomain
fn log2(self) -> Self::Codomain
fn log10(self) -> Self::Codomain
fn ln_1p(self) -> Self::Codomain
fn to_degrees(self) -> Self::Codomain
fn to_radians(self) -> Self
fn sin(self) -> Self
fn cos(self) -> Self
fn tan(self) -> Self::Codomain
fn asin(self) -> Self::Codomain
fn acos(self) -> Self::Codomain
fn atan(self) -> Self
fn sin_cos(self) -> (Self, Self)
fn sinh(self) -> Self
fn cosh(self) -> Self
fn tanh(self) -> Self
fn asinh(self) -> Self::Codomain
fn acosh(self) -> Self::Codomain
fn atanh(self) -> Self::Codomain
Source§impl<T, C> UpperExp for Constrained<T, C>where
T: UpperExp,
impl<T, C> UpperExp for Constrained<T, C>where
T: UpperExp,
Source§impl<T, C, E> Zero for Constrained<T, C>
impl<T, C, E> Zero for Constrained<T, C>
impl<T, C> Copy for Constrained<T, C>where
T: Copy,
impl<T, C> Eq for Constrained<T, C>where
T: Primitive,
Auto Trait Implementations§
impl<T, C> Freeze for Constrained<T, C>where
T: Freeze,
impl<T, C> RefUnwindSafe for Constrained<T, C>where
T: RefUnwindSafe,
impl<T, C> Send for Constrained<T, C>where
T: Send,
impl<T, C> Sync for Constrained<T, C>where
T: Sync,
impl<T, C> Unpin for Constrained<T, C>where
T: Unpin,
impl<T, C> UnwindSafe for Constrained<T, C>where
T: UnwindSafe,
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> CanonicalEq for Twhere
T: ToCanonical,
impl<T> CanonicalEq for Twhere
T: ToCanonical,
fn eq_canonical(&self, other: &T) -> bool
Source§impl<T> CanonicalHash for Twhere
T: ToCanonical,
impl<T> CanonicalHash for Twhere
T: ToCanonical,
fn hash_canonical<H>(&self, state: &mut H)where
H: Hasher,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LowerBounded for Twhere
T: Bounded,
impl<T> LowerBounded for Twhere
T: Bounded,
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
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