pub trait AbstractRing<A: Operator = Additive, M: Operator = Multiplicative>: AbstractGroupAbelian<A> + AbstractMonoid<M> {
// Provided methods
fn prop_mul_and_add_are_distributive_approx(
args: (Self, Self, Self),
) -> bool
where Self: RelativeEq { ... }
fn prop_mul_and_add_are_distributive(args: (Self, Self, Self)) -> bool
where Self: Eq { ... }
}
Expand description
A ring is the combination of an Abelian group and a multiplicative monoid structure.
A ring is equipped with:
-
An abstract operator (usually the addition, “+”) that fulfills the constraints of an Abelian group.
An Abelian group is a set with a closed commutative and associative addition with the divisibility property and an identity element.
-
A second abstract operator (usually the multiplication, “×”) that fulfills the constraints of a monoid.
A set equipped with a closed associative multiplication with the divisibility property and an identity element.
The multiplication is distributive over the addition:
§Distributivity
a, b, c ∈ Self, a × (b + c) = a × b + a × c.
Provided Methods§
Sourcefn prop_mul_and_add_are_distributive_approx(args: (Self, Self, Self)) -> boolwhere
Self: RelativeEq,
fn prop_mul_and_add_are_distributive_approx(args: (Self, Self, Self)) -> boolwhere
Self: RelativeEq,
Returns true
if the multiplication and addition operators are distributive for
the given argument tuple. Approximate equality is used for verifications.
Sourcefn prop_mul_and_add_are_distributive(args: (Self, Self, Self)) -> boolwhere
Self: Eq,
fn prop_mul_and_add_are_distributive(args: (Self, Self, Self)) -> boolwhere
Self: Eq,
Returns true
if the multiplication and addition operators are distributive for
the given argument tuple.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.