3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 18:05:21 +00:00

[Z3py] Fix error in FPRef.__neg__()

`FPRef.__neg__()` did not work previously because it tried to construct an FPRef from an FPRef (`fpNeg()` already returns an FPRef).
This commit is contained in:
Andres Nötzli 2016-03-16 17:12:45 -07:00
parent 6b2d84b2be
commit 34da0a32b9

View file

@ -8178,8 +8178,13 @@ class FPRef(ExprRef):
return self
def __neg__(self):
"""Create the Z3 expression `-self`."""
return FPRef(fpNeg(self))
"""Create the Z3 expression `-self`.
>>> x = FP('x', Float32())
>>> -x
-x
"""
return fpNeg(self)
def __div__(self, other):
"""Create the Z3 expression `self / other`.