Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 19s
Two-line baseline: let rec gcd a b = if b = 0 then a else gcd b (a mod b) let lcm a b = a * b / gcd a b gcd 36 48 = 12 lcm 4 6 = 12 lcm 12 18 = 36 sum = 60 Tests mod arithmetic and the integer-division fix from iteration 94 (without truncate-toward-zero, 'lcm 4 6 = 4 * 6 / 2 = 12.0' rather than the expected 12). 54 baseline programs total.
7 lines
122 B
OCaml
7 lines
122 B
OCaml
let rec gcd a b = if b = 0 then a else gcd b (a mod b)
|
|
|
|
let lcm a b = a * b / gcd a b
|
|
;;
|
|
|
|
gcd 36 48 + lcm 4 6 + lcm 12 18
|