RosettaCodeData/Task/Least-common-multiple/Maxima/least-common-multiple.maxima
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

6 lines
231 B
Text

lcm(a, b); /* a and b may be integers or polynomials */
/* In Maxima the gcd of two integers is always positive, and a * b = gcd(a, b) * lcm(a, b),
so the lcm may be negative. To get a positive lcm, simply do */
abs(lcm(a, b))