numpy.lcm
-
numpy.lcm(x1, x2, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'lcm'> -
Возвращает наименьшее общее кратное
|x1|и|x2|Параметры: -
x1, x2 : array_like, int -
Массивы значений
Возвращает: -
y : ndarray or scalar -
Наименьшее общее кратное абсолютного значения входных данных. Это скалярное значение, если оба
x1иx2являются скалярами.
См. также
-
gcd - Наибольший общий делитель
Примеры
>>> 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])
-
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.15.4/reference/generated/numpy.lcm.html