Greatest common divisor: Difference between revisions

Go -- iterative version
(Go -- iterative version)
Line 695:
 
=={{header|Go}}==
===Iterative===
this is just a wrapper for <tt>big.GcdInt</tt>
<lang go>func gcd(x, y int) int {
for y != 0 {
x, y = y, x % y
}
return x
}</lang>
===Builtin===
this(This is just a wrapper for <tt>big.GcdInt</tt>)
<lang go>import "big"
func gcd(x, y int64) int64 {
Anonymous user