add partitioned signal any() operator
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 16 Jan 2021 18:40:50 +0000 (18:40 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 16 Jan 2021 18:40:50 +0000 (18:40 +0000)
src/ieee754/part/partsig.py

index 53561d4bcc97c0dca31981261428b48d2e69dfff..ed221d3e402028f59cbc12b1e61c2b62243caa88 100644 (file)
@@ -281,6 +281,7 @@ class PartitionedSignal:
         Value, out
             ``1`` if any bits are set, ``0`` otherwise.
         """
+        return self != Const(0) # leverage the __ne__ operator here
         return Operator("r|", [self])
 
     def all(self):