public NetBigInteger Pow(int exp)
{
if (exp < 0)
{
throw new ArithmeticException("Negative exponent");
}
if (exp == 0)
{
return One;
}
if (m_sign == 0 || Equals(One))
{
return this;
}
NetBigInteger y = One;
NetBigInteger z = this;
for (; ; )
{
if ((exp & 0x1) == 1)
{
y = y.Multiply(z);
}
exp >>= 1;
if (exp == 0) break;
z = z.Multiply(z);
}
return y;
}