summaryrefslogtreecommitdiff
path: root/numpy/lib/polynomial.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r--numpy/lib/polynomial.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index 6964277a3..edaa319cd 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -547,6 +547,12 @@ class poly1d(object):
def __call__(self, val):
return polyval(self.coeffs, val)
+ def __neg__(self):
+ return poly1d(-self.coeffs)
+
+ def __pos__(self):
+ return self
+
def __mul__(self, other):
if isscalar(other):
return poly1d(self.coeffs * other)