must declare carry equal to width of partitions+1
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 22 Feb 2020 17:13:26 +0000 (17:13 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 22 Feb 2020 17:13:26 +0000 (17:13 +0000)
src/ieee754/part/partsig.py

index ea1fa3a6572ad64089fd2fdec77fcf29a90d571c..33cc5feac86dda735d36623de2e815c45f5854b9 100644 (file)
@@ -64,7 +64,7 @@ class PartitionedSignal:
     # unary ops that require partitioning
 
     def __neg__(self):
-        z = Const(0, self.sig.shape())
+        z = Const(0, len(self.partpoints)+1)
         result, _ = self.add_op(self, ~0, carry=z)  # TODO, subop
         return result
 
@@ -117,7 +117,7 @@ class PartitionedSignal:
         return (pa.output, 0)
 
     def __lshift__(self, other):
-        z = Const(0, self.sig.shape())
+        z = Const(0, len(self.partpoints)+1)
         result, _ = self.ls_op(self, other, carry=z) # TODO, carry
         return result