nifty GCD

So following the ScaLa Course by Martin Odersky on Coursera, I realized how concise the Euclidean Algorithm for computing the greatest common divisor of two integers really is. In Scala, it’s just one line:

def gcd(a: Int, b: Int): Int = if(b==0) a else gcd(b, a%b)
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.