You are viewing a single comment's thread. Return to all comments →
Scala Code :
if ( x == 0) return y if( y == 0) return x if ( x==y) return x if ( x > y) { gcd(x-y,y) } else { gcd(x,y-x) }
Seems like cookies are disabled on this browser, please enable them to open this website
Computing the GCD
You are viewing a single comment's thread. Return to all comments →
Scala Code :
if ( x == 0) return y if( y == 0) return x if ( x==y) return x if ( x > y) { gcd(x-y,y) } else { gcd(x,y-x) }