The extended Euclidean algorithm computes the GCD of two integer numbers while determining the Bézout coefficients 𝑥 and 𝑦 such that 𝑎𝑥+𝑏𝑦=gcd(𝑎,𝑏). This method is particularly useful in number theory and cryptography, especially for computing modular inverses, which are essential in methods such as RSA encryption.
The attached livescript provides the implementation of the extended Euclidean algorithm in both recursive and iterative versions. Each version is accompanied by an explanation of its correctness.
引用格式
Claudio Fontana (2025). Extended Euclidean Algorithm (EEA) (https://ww2.mathworks.cn/matlabcentral/fileexchange/180770-extended-euclidean-algorithm-eea), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2024b
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0 |