From 93b53a5354620d94b128008d0b17670cc87c92f5 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 21 Mar 2024 12:51:02 +0100 Subject: Added lcm --- samples/rosetta/least_common_multiple.bruijn | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 samples/rosetta/least_common_multiple.bruijn (limited to 'samples/rosetta/least_common_multiple.bruijn') diff --git a/samples/rosetta/least_common_multiple.bruijn b/samples/rosetta/least_common_multiple.bruijn new file mode 100644 index 0000000..9a6c08e --- /dev/null +++ b/samples/rosetta/least_common_multiple.bruijn @@ -0,0 +1,8 @@ +:import std/Math . + +lcm [[=?1 1 (=?0 0 |(1 / (gcd 1 0) ⋅ 0))]] + +:test ((lcm (+12) (+18)) =? (+36)) ([[1]]) +:test ((lcm (+42) (+25)) =? (+1050)) ([[1]]) + +main [[0]] -- cgit v1.2.3