Ejemplo n.º 1
0
        //For this definition one should usually assume that IMultiplicativeGroup<M> is abelian
        public static M ScalarPow <M>(this IMultiplicativeGroup <M> g, M a, int n)
        {
            var res = (g as IMultiplicativeMonoid <M>).ScalarPow(a, Math.Abs(n));

            if (n < 0)
            {
                res = g.Inverse(res);
            }
            return(res);
        }
Ejemplo n.º 2
0
 public static M Divide <M>(this IMultiplicativeGroup <M> g, M a, M b)
 {
     return(g.Multiply(a, g.Inverse(b)));
 }