home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / SPECFUN.DI$ / LCM.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  329 b   |  13 lines

  1. function c = lcm(a,b)
  2. %LCM    Least common multiple.
  3. %    LCM(A,B) is the least common multiple of positive integers A and B.
  4. %
  5. %    See also GCD.
  6.  
  7. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  8.  
  9. if round(a) ~= a | round(b) ~= b | a < 1 | b < 1
  10.     error('Input arguments must contain positive integers.');
  11. end
  12. c = a*b/gcd(a,b);
  13.