RosettaCodeData/Task/Least-common-multiple/Logo/least-common-multiple-1.logo
2023-07-01 13:44:08 -04:00

11 lines
180 B
Text

to abs :n
output sqrt product :n :n
end
to gcd :m :n
output ifelse :n = 0 [ :m ] [ gcd :n modulo :m :n ]
end
to lcm :m :n
output quotient (abs product :m :n) gcd :m :n
end