BigInteger.ModPow(BigInteger, BigInteger, BigInteger) 메서드

정의

다른 숫자의 힘만큼 높아진 수에 대해 모듈러스 나누기를 수행합니다.

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

매개 변수

value
BigInteger

전원에 올릴 수 있는 숫자입니다 exponent .

exponent
BigInteger

발생 value 할 지수입니다.

modulus
BigInteger

권력으로 나눌 value 수 있는 숫자입니다 exponent .

반품

지수modulus를 나눈 후의 value 나머지 값입니다.

예외

modulus 가 0입니다.

exponent 가 음수입니다.

예제

다음 예제에서는 메서드를 호출 ModPow 하는 간단한 그림을 제공합니다.

using System;
using System.Numerics;

public class Class1
{
   public static void Main()
   {
      BigInteger number = 10;
      int exponent = 3;
      BigInteger modulus = 30;
      Console.WriteLine("({0}^{1}) Mod {2} = {3}",
                        number, exponent, modulus,
                        BigInteger.ModPow(number, exponent, modulus));
   }
}
// The example displays the following output:
//      (10^3) Mod 30 = 10
open System.Numerics;

let number = 10I;
let exponent = 3;
let modulus = 30I;
printfn $"({number}^{exponent}) Mod {modulus} = {BigInteger.ModPow(number, exponent, modulus)}"
// The example displays the following output:
//      (10^3) Mod 30 = 10
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim number As BigInteger = 10
      Dim exponent As Integer = 3
      Dim modulus As BigInteger = 30
      Console.WriteLine("({0}^{1}) Mod {2} = {3}", _
                        number, exponent, modulus, _
                        BigInteger.ModPow(number, exponent, modulus))
   End Sub   
End Module
' The example displays the following output:
'       (10^3) Mod 30 = 10

설명

메서드는 ModPow 다음 식을 평가합니다.

(baseValue ^ 지수) 모드 모듈러스

모듈러스 나누기 없이 값에 대한 BigInteger 지수를 수행하려면 이 메서드를 Pow 사용합니다.

적용 대상

추가 정보