// It computes x^y mod m. Negative y are supported.
It computes x^y mod m. Negative y are supported.
// It computes x^y mod m . Negative y are supported .
func Exponentiate(x, y, m *big.Int) *big.Int {
	var r *big.Int
	if y.Cmp(big.NewInt(0)) >= 0 {
		r = new(big.Int).Exp(x, y, m)
	} else {
		r = new(big.Int).Exp(x, new(big.Int).Abs(y), m)
		r.ModInverse(r, m)
	}
	return r
}
func Exponentiate ( x , y , m * big . Int ) * big . Int { var r * big . Int if y . Cmp ( big . NewInt ( 0 ) ) >= 0 { r = new ( big . Int ) . Exp ( x , y , m ) } else { r = new ( big . Int ) . Exp ( x , new ( big . Int ) . Abs ( y ) , m ) r . ModInverse ( r , m ) } return r }
It computes x^y mod m. Negative y are supported.
It computes x^y mod m . Negative y are supported .