<< NL_S_GCD NL_S: Security NL_S_GCDIterative >>

NARVAL >> NL_S: Security > NL_S_GCDExtended

NL_S_GCDExtended

Perform the greatest common divisor between two integers and the solutions of the Bezout's identity (Extended Euclidian algorithm).

Calling Sequence

[G,U,V] = NL_S_GCDExtended(A,B)

Arguments

A :

Integer.

B :

Integer.

G :

Greatest common divisor.

U :

Bezout first factor.

V :

Bezout second factor.

Description

NL_S_GCDExtended performs the greatest common divisor (GCD) G of the two integers A and B in respect with the Extended Euclidian algorithm (WIKIPEDIA). It also finds the integers U and V (one of which is typically negative) that satisfy the Bézout's identity AU+BV=G.

Examples

a=141;//integer
b=255;//integer
[g,u,v]=NL_S_GCDExtended(a,b)//application of NL_S_GCDExtended

Report an issue
<< NL_S_GCD NL_S: Security NL_S_GCDIterative >>