We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d1a50aa + 42ee143 commit a79eeeeCopy full SHA for a79eeee
symengine/lib/symengine_wrapper.in.pyx
@@ -951,6 +951,9 @@ cdef class Basic(object):
951
def __neg__(Basic self not None):
952
return c2py(symengine.neg(self.thisptr))
953
954
+ def __pos__(self):
955
+ return self
956
+
957
def __abs__(Basic self not None):
958
return c2py(symengine.abs(self.thisptr))
959
symengine/tests/test_arit.py
@@ -95,6 +95,12 @@ def test_arit8():
95
assert (2*y**(-2*x**2)) * (3*y**(2*x**2)) == 6
96
97
98
+def test_unary():
99
+ x = Symbol("x")
100
+ assert -x == 0 - x
101
+ assert +x == x
102
103
104
def test_expand1():
105
x = Symbol("x")
106
y = Symbol("y")
0 commit comments