public static FiniteRingElement Distance(FiniteRingElement elem1, FiniteRingElement elem2) { if (!elem1.OwnerRing.Equals(elem2.OwnerRing)) { throw new ArgumentException("Rings must be similar!"); } return(new FiniteRingElement(Math.Abs(elem1.Value - elem2.Value), elem1.OwnerRing)); }
public bool Contains(FiniteRingElement elem) { return(order == elem.OwnerRing.Order); }