//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); }
public static M Divide <M>(this IMultiplicativeGroup <M> g, M a, M b) { return(g.Multiply(a, g.Inverse(b))); }