RosettaCodeData/Task/Least-common-multiple/F-Sharp/least-common-multiple.fs

4 lines
90 B
Forth
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
let rec gcd x y = if y = 0 then abs x else gcd y (x % y)
let lcm x y = x * y / (gcd x y)