Sunday, January 31, 2016

Euclidean Algorithm for GCD

The Euclidean algorithm is a cool little way to find the GCD of two integers. 

Say you have 46 and 90...

Then 95 = 46 * 2 + 3
And 46 = 3 * 15 + 1
3 = 1 * 3 + 0

so the GCD of 95 and 46 is 1. Maybe not the best example, but I'm hungover so you can google it.

No comments:

Post a Comment