<< NARVAL_R_TreeN2R NARVAL NARVAL_S_Gcd >>

NARVAL >> NARVAL > NARVAL_S_ExtGcd

NARVAL_S_ExtGcd

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

Calling Sequence

[g,u,v] = NARVAL_S_ExtGcd(a,b)

Parameters

a :

integer.

b :

integer.

g :

greatest common divisor.

u :

Bezout first factor.

v :

Bezout second factor.

Description

NARVAL_S_ExtGcd 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]=NARVAL_S_ExtGcd(a,b);//application of NARVAL_S_ExtGcd
g
u
v

Authors

Foued Melakessou

Contact

Dr. Foued Melakessou

Research Associate

Interdisciplinary Centre for Security, Reliability and Trust

Room F106

University of Luxembourg

6, rue Coudenhove Kalergi

L-1359 Luxembourg-Kirchberg

E-mail: foued.melakessou@uni.lu

Tel: (+352) 46 66 44 5346

Home Page


<< NARVAL_R_TreeN2R NARVAL NARVAL_S_Gcd >>