(self, val)
| 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) |