dpnp.lcm

dpnp.lcm(x1, x2, out=None, where=True, order='K', dtype=None, subok=True, **kwargs)

Returns the lowest common multiple of |x1| and |x2|.

For full documentation refer to numpy.lcm.

Parameters:
  • x1 ({dpnp.ndarray, usm_ndarray, scalar}) -- First input array, expected to have an integer data type. Both inputs x1 and x2 can not be scalars at the same time.

  • x2 ({dpnp.ndarray, usm_ndarray, scalar}) -- Second input array, also expected to have an integer data type. Both inputs x1 and x2 can not be scalars at the same time. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

  • out ({None, dpnp.ndarray, usm_ndarray}, optional) -- Output array to populate. Array must have the correct shape and the expected data type. Default: None.

  • order ({"C", "F", "A", "K"}, optional) -- Memory layout of the newly output array, if parameter out is None. Default: "K".

Returns:

out -- The lowest common multiple of the absolute value of the inputs.

Return type:

dpnp.ndarray

Limitations

Parameters where and subok are supported with their default values. Keyword argument kwargs is currently unsupported. Otherwise NotImplementedError exception will be raised.

See also

dpnp.gcd

The greatest common divisor.

Examples

>>> import dpnp as np
>>> np.lcm(np.array(12), 20)
array(60)
>>> np.lcm(np.arange(6), 20)
array([ 0, 20, 20, 60, 20, 20])