From 421a94b195c9b16986e0b614b4376bd13600b70c Mon Sep 17 00:00:00 2001 From: Rhinemann Date: Tue, 27 Jun 2023 22:47:13 +0300 Subject: [PATCH] Renamed reverse to negate. --- bitutilities.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bitutilities.py b/bitutilities.py index 35bc7a3..1676435 100644 --- a/bitutilities.py +++ b/bitutilities.py @@ -35,7 +35,7 @@ class BasicRegister: [False] * max(resulting_size - current_memory_size, 0) + list(self.memory)[-resulting_size:] ) - def reverse(self): + def negate(self): """ Performs a logical negation on the register. """ @@ -136,7 +136,7 @@ def binary_subtraction(minuend: BasicRegister, subtrahend: BasicRegister) -> Bas :return: Register containing the difference. :rtype: BasicRegister """ - subtrahend.reverse() + subtrahend.negate() difference: BasicRegister final_carry: bool @@ -145,7 +145,7 @@ def binary_subtraction(minuend: BasicRegister, subtrahend: BasicRegister) -> Bas if final_carry: return binary_sum(difference, BasicRegister([False] * (len(difference) - 1) + [True])) else: - difference.reverse() + difference.negate() return difference