Greatest common divisor: Difference between revisions
Content added Content deleted
Line 490: | Line 490: | ||
=={{header|F_Sharp|F#}}== |
=={{header|F_Sharp|F#}}== |
||
<lang fsharp>open System |
<lang fsharp>open System |
||
let rec |
let rec gcd a b = |
||
match b with |
match b with |
||
| 0 -> |
| 0 -> a |
||
| _ -> |
| _ -> gcd b (a % b) |
||
>gcd 400 600 |
|||
val it : int = 200</lang> |
|||
=={{header|Factor}}== |
=={{header|Factor}}== |