ExtendedGreatestCommonDivisorL 함수
네임스페이스: Microsoft.Quantum.Math
패키지: Microsoft.Quantum.Standard
선형 조합으로 분해된 두 정수의 GCD를 반환합니다.
function ExtendedGreatestCommonDivisorL (a : BigInt, b : BigInt) : (BigInt, BigInt)
Description
$u \cdot a + v \cdot b = \operatorname{GCD}(a, b)$를 계산합니다. 여기서 $\operatorname{GCD}$는 $a$ 및 $b$의 가장 큰 공통 $a$입니다. GCD는 항상 긍정적입니다.
입력
a: BigInt
가장 큰 확장 공통 제수가 계산되는 첫 번째 수입니다.
b: BigInt
확장된 최대 공통 제수가 계산되는 두 번째 수입니다.
출력: (BigInt, BigInt)
속성이 $u \cdot a + v \cdot b = \operatorname{GCD}(a, b)$인 튜플 $(u,v)$
참조
- 이 구현은 다음과 같습니다. https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm