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
Activity
eric-wieser commentedon Mar 11, 2017
Sounds like you're after a
gufuncforgcd(and why notlcmas well?)Although
lcmcould be implemented as a regularufunchere and then you could usenp.lcm.reduce(d, axis=...)for your second case.That wouldn't work for- wait, turns out I'm an idiot, andgcd, although you've made me thing about ways it could be made to work (#8773).gcdis associativeENH: Add gcd and lcm ufuncs