You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sounds like you're after a gufunc for gcd (and why not lcm as well?)
Although lcm could be implemented as a regular ufunc here and then you could use np.lcm.reduce(d, axis=...) for your second case. That wouldn't work for gcd, although you've made me thing about ways it could be made to work (#8773). - wait, turns out I'm an idiot, and gcd is associative
Essentially,
math.gcd
, but operating on numpy arrays withdtype=
something in theint
family.Would support broadcasting:
Might want to have a version that operates on multiple values (more than 2) on an axis of a multivariable array:
(This is slightly related to #4829.)
The text was updated successfully, but these errors were encountered: