示例#1
0
        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));
        }
示例#2
0
 public bool Contains(FiniteRingElement elem)
 {
     return(order == elem.OwnerRing.Order);
 }