Functions and CALL Routines |
Returns the least common multiple.
- x
-
specifies a numeric constant, variable, or expression that
has an integer value.
The LCM (least common multiple) function returns the smallest
multiple that is exactly divisible by every member of a set of numbers. For
example, the least common multiple of 12 and 18 is 36.
If any of the arguments are missing, then the returned value is a missing
value.
The following example returns the smallest multiple that is exactly
divisible by the integers 10 and 15.
data _null_;
x=lcm(10,15);
put x=;
run;
SAS writes the following output to the log:
x=30
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.