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 GCD (a:int) (b:int) =
let rec gcd a b =
match b with
match b with
| 0 -> Math.Abs(a)
| 0 -> a
| _ -> GCD b (a % b)</lang>
| _ -> gcd b (a % b)

>gcd 400 600
val it : int = 200</lang>


=={{header|Factor}}==
=={{header|Factor}}==