Stein's algorithm

Home > Mathematics > Number theory > Greatest common divisor (GCD) > Stein's algorithm

It is an efficient algorithm to compute GCD of two integers that uses only bit shifting, subtraction, and conditional swaps without multiplication or division.