What does the lcm procedure do?
It computes and returns the least of the positive integers that are evenly
divisible by all of its operands. (But if any of its operands is 0, the
lcm procedure returns 0; and if it receives no operands at
all, it returns 1.)
Do all the operands have to be integers?> (lcm 165 70) 2310 > (lcm -165 -70) 2310 > (lcm 1000 1001) 1001000 > (lcm 12 18 30) 180 > (lcm 360) 360 > (lcm 0 12) 0 > (lcm 60 84 140 210) 420 > (lcm 0 0 0) 0 > (lcm) 1
Yes. This preserves the analogy between gcd and
lcm.
Next topic
Previous topic
Table of contents
This document is available on the World Wide Web as
http://www.math.grin.edu/~stone/scheme-web/lcm.html