nums.numpy.lcm

nums.numpy.lcm(x1, x2, out=None, where=True, **kwargs)[source]

This docstring was copied from numpy.lcm.

Some inconsistencies with the NumS version may exist.

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

Parameters
  • x1 (BlockArray, int) – Arrays of values. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

  • x2 (BlockArray, int) – Arrays of values. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

Returns

y – The lowest common multiple of the absolute value of the inputs

Return type

BlockArray

See also

gcd

The greatest common divisor

Examples

The doctests shown below are copied from NumPy. They won’t show the correct result until you operate get().

>>> nps.lcm(nps.array(12), nps.array(20)).get()  
array(60)
>>> nps.lcm(nps.arange(6), nps.array(20)).get()  
array([ 0, 20, 20, 60, 20, 20])