Fix PartitionedSignal.neg and its test case
[ieee754fpu.git] / src / ieee754 / part / partsig.py
index d710b7ff186620dd60435fa4265bc27b5bd448f1..3d3cd675dae4ea82248cdc4261d6a9cc030ad6ae 100644 (file)
@@ -68,8 +68,8 @@ class PartitionedSignal:
     # unary ops that require partitioning
 
     def __neg__(self):
-        z = Const(0, len(self.partpoints)+1)
-        result, _ = self.add_op(self, ~0, carry=z)  # TODO, subop
+        z = Const(0, len(self.sig))
+        result, _ = self.sub_op(z, self)
         return result
 
     # binary ops that don't require partitioning