RosettaCodeData/Task/Least-common-multiple/Logo/least-common-multiple-1.logo
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07: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