Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,26 @@
' Least common multiple
PROGRAM "leastcommonmultiple"
VERSION "0.0001"
DECLARE FUNCTION Entry()
INTERNAL FUNCTION Gcd(m&, n&)
INTERNAL FUNCTION Lcm(m&, n&)
FUNCTION Entry()
PRINT "LCM(35, 21) ="; Lcm(35, 21)
END FUNCTION
FUNCTION Gcd(m&, n&)
DO WHILE m& <> 0
tmp& = m&
m& = n& MOD m&
n& = tmp&
LOOP
RETURN n&
END FUNCTION
FUNCTION Lcm(m&, n&)
RETURN m& / Gcd(m&, n&) * n&
END FUNCTION
END PROGRAM