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