本文整理匯總了C#中BigInteger.Power方法的典型用法代碼示例。如果您正苦於以下問題:C# BigInteger.Power方法的具體用法?C# BigInteger.Power怎麽用?C# BigInteger.Power使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BigInteger
的用法示例。
在下文中一共展示了BigInteger.Power方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Power_with_exponent_0_is_one
public void Power_with_exponent_0_is_one()
{
BigInteger i = new BigInteger(1, 0x1);
Expect(SameValue(i.Power(0), 1, new uint[] { 1 }));
}
示例2: Power_on_negative_exponent_fails
public void Power_on_negative_exponent_fails()
{
BigInteger i = new BigInteger(1, 0x1);
i.Power(-2);
}
示例3: Power_on_power_of_two_exponent_works
public void Power_on_power_of_two_exponent_works()
{
BigInteger i = new BigInteger(1, 0x2);
BigInteger p = i.Power(256);
BigInteger p2_to_256 = new BigInteger(1,
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0);
Expect(p == p2_to_256);
}
示例4: Power_on_completely_odd_exponent_works
public void Power_on_completely_odd_exponent_works()
{
BigInteger i = new BigInteger(1,0x2);
BigInteger p = i.Power(255);
BigInteger p2_to_255 = new BigInteger(1,
0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0);
Expect(p == p2_to_255);
}