xorbits.numpy.lcm#

xorbits.numpy.lcm = <function wrap_fallback_module_method.<locals>._wrapped>#

lcm(x1, x2, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature, extobj])

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

Parameters
  • x1 (array_like, 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 (array_like, 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 This is a scalar if both x1 and x2 are scalars.

Return type

ndarray or scalar

See also

gcd

The greatest common divisor

Examples

>>> np.lcm(12, 20)  
60
>>> np.lcm.reduce([3, 12, 20])  
60
>>> np.lcm.reduce([40, 12, 20])  
120
>>> np.lcm(np.arange(6), 20)  
array([ 0, 20, 20, 60, 20, 20])

Warning

This method has not been implemented yet. Xorbits will try to execute it with numpy.

This docstring was copied from numpy.