Anonymous user
Greatest common divisor: Difference between revisions
→{{header|Kotlin}}
(add Fermat) |
|||
Line 2,337:
=={{header|Kotlin}}==
Recursive one line solution:
<lang kotlin>tailrec fun gcd(a: Int, b: Int): Int = if (b == 0) kotlin.math.abs(a) else gcd(b, a % b)</lang>
=={{header|LabVIEW}}==
|