MCPcopy Create free account
hub / github.com/numpy/numpy / __pow__

Method __pow__

numpy/lib/polynomial.py:1356–1362  ·  view source on GitHub ↗
(self, val)

Source from the content-addressed store, hash-verified

1354 return poly1d(polyadd(self.coeffs, other.coeffs))
1355
1356 def __pow__(self, val):
1357 if not isscalar(val) or int(val) != val or val < 0:
1358 raise ValueError("Power to non-negative integers only.")
1359 res = [1]
1360 for _ in range(val):
1361 res = polymul(self.coeffs, res)
1362 return poly1d(res)
1363
1364 def __sub__(self, other):
1365 other = poly1d(other)

Callers

nothing calls this directly

Calls 3

isscalarFunction · 0.90
poly1dClass · 0.85
polymulFunction · 0.70

Tested by

no test coverage detected