Now that we have an integer library, let's see if we can do some 2300-year-old mathematics. The Euclidean Algorithm as you probably recall dates from at least 300 BC and determines the greatest common divisor (GCD) of two natural numbers. The Extended Euclidean Algorithm solves Bézout's Identity: given non-negative integers a and b, it finds integers x and y such that:

.net
frameworks
other languages