BigInteger.Pow(BigInteger, Int32) 메서드

정의

BigInteger 값을 지정된 값의 거듭제곱으로 변환합니다.

public:
 static System::Numerics::BigInteger Pow(System::Numerics::BigInteger value, int exponent);
public static System.Numerics.BigInteger Pow (System.Numerics.BigInteger value, int exponent);
static member Pow : System.Numerics.BigInteger * int -> System.Numerics.BigInteger
Public Shared Function Pow (value As BigInteger, exponent As Integer) As BigInteger

매개 변수

value
BigInteger

exponent 지수로 사용할 숫자입니다.

exponent
Int32

value를 거듭제곱할 지수입니다.

반환

valueexponent번 거듭제곱한 결과입니다.

예외

exponent가 음수입니다.

예제

다음 예제에서는 값과 값 범위가 0에서 10인 지수를 사용하는 BigInteger 지수를 보여 줍니다.

BigInteger numericBase = 3040506;
for (int ctr = 0; ctr <= 10; ctr++)
{
   Console.WriteLine(BigInteger.Pow(numericBase, ctr));
}
//
// The example produces the following output to the console:
//
// 1
// 3040506
// 9244676736036
// 28108495083977874216
// 85464047953805230420993296
// 259853950587832525926412642447776
// 790087495886008322074413197838317614656
// 2402265771766383619317185774506591737267255936
// 7304103492650319992835619250501939216711515276943616
// 22208170494024253840136657344866649200046662468638726109696
// 67524075636103707946458547477011116092637077515870858568887346176     //
Dim base As BigInteger = 3040506
For ctr As Integer = 0 To 10
   Console.WriteLine(BigInteger.Pow(base, ctr))
Next
' 
' The example produces the following output to the console:
'
' 1
' 3040506
' 9244676736036
' 28108495083977874216
' 85464047953805230420993296
' 259853950587832525926412642447776
' 790087495886008322074413197838317614656
' 2402265771766383619317185774506591737267255936
' 7304103492650319992835619250501939216711515276943616
' 22208170494024253840136657344866649200046662468638726109696
' 67524075636103707946458547477011116092637077515870858568887346176     '

설명

Pow 지수 매개 변수의 값이 0이거나 및 exponent 매개 변수의 값이 0인 경우 메서드는 1을 value 반환합니다. 가 1이면 exponent 메서드는 를 Pow 반환합니다 value. 가 음수이면 value 메서드는 음수 결과를 반환합니다.

이 메서드는 기본 숫자 형식의 Math.Pow 메서드에 해당합니다.

적용 대상