A ring is a standard mathematical structure that describes objects that can be added and multiplied. Do C # and Java longdo all the properties of a ring? For example, is multiplication by Long.MIN_VALUE always associative and distributive? Suppose we are in an uncontrollable context.
(definition copied from Wikipedia)
A ring is a set R equipped with binary operations + and •, satisfying the following three sets of axioms, called ring axioms.
- R is an Abelian group when added, which means that
- (a + b) + c = a + (b + c) for all a, b, c in R (+ associative).
- a + b = b + a for all a, b in R (+ is commutative).
- There is an element 0 in R such that a + 0 = a for all a from R (0 is an additive identity).
- For each a from R, there exists -a in R such that a + (-a) = 0 (-a is the additive inversion of a).
- R is a monoid when multiplied, which means:
- (a ⋅ b) ⋅ c = a ⋅ (b ⋅ c) for all a, b, c in R (⋅ is associative).
- There is an element 1 in R such that a ⋅ 1 = a and 1 ⋅ a = a for all a from R (1 is a multiplicative identity).
- Multiplication is distributive with respect to addition:
- a ⋅ (b + c) = (a ⋅ b) + (a ⋅ c) for all a, b, c in R (left distributivity).
- (b + c) ⋅ a = (b ⋅ a) + (c ⋅ a) for all a, b, c in R (right distributivity).
A commutative ring is one where the multiplication is commutative (this means that ⋅ b = b ⋅ a).
source
share