lcm¶
-
lcm(x1, x2, out=None, **kwargs)¶ Returns the lowest common multiple of
|x1|and|x2|Parameters: - x1, x2 : ndarrays or scalar values
The arrays for computing lowest common multiple. If x1.shape != x2.shape, they must be broadcastable to a common shape (which may be the shape of one or the other).
- out : ndarray or None, optional
A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned.
Returns: - y : ndarray or scalar
The lowest common multiple of the absolute value of the inputs This is a scalar if both x1 and x2 are scalars.
See also
gcd- The greatest common divisor
Examples
>>> np.lcm(12, 20) 60 >>> np.lcm(np.arange(6, dtype=int), 20) array([ 0, 20, 20, 60, 20, 20], dtype=int64)