bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / lcm
ufunc
numpy:lcm
source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/__init__.py
Summary
Returns the lowest common multiple of |x1| and |x2|
Parameters
x1, x2: array_like, intArrays of values. If
x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).
Returns
y: ndarray or scalarThe lowest common multiple of the absolute value of the inputs This is a scalar if both x1 and x2 are scalars.
Examples
import numpy as np
✓np.lcm(12, 20) np.lcm.reduce([3, 12, 20]) np.lcm.reduce([40, 12, 20])✗
np.lcm(np.arange(6), 20)
✓See also
- gcd
The greatest common divisor
Aliases
-
numpy.lcm