invert partitioned op is just a bit-wise invert
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 7 Feb 2020 16:27:35 +0000 (16:27 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 7 Feb 2020 16:27:35 +0000 (16:27 +0000)
src/ieee754/part/partsig.py

index 9e1c3f72d0f6662c255949dd563fbcf95aed9df3..4fb74507ea96fa2310415c0cf97abd52647d3e35 100644 (file)
@@ -53,10 +53,13 @@ class PartitionedSignal:
             return self.sig.eq(val.sig)
         return self.sig.eq(val)
 
-    # unary  ops that require partitioning
+    # unary ops that do not require partitioning
 
     def __invert__(self):
-        return Operator("~", [self])
+        return ~self.sig
+
+    # unary ops that require partitioning
+
     def __neg__(self):
         return Operator("-", [self])