From 6cee09b3cf458b0a25bf98983696783c0ba5d1ce Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 7 Feb 2020 16:27:35 +0000 Subject: [PATCH] invert partitioned op is just a bit-wise invert --- src/ieee754/part/partsig.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ieee754/part/partsig.py b/src/ieee754/part/partsig.py index 9e1c3f72..4fb74507 100644 --- a/src/ieee754/part/partsig.py +++ b/src/ieee754/part/partsig.py @@ -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]) -- 2.30.2