Renamed reverse to negate.

This commit is contained in:
Rhinemann 2023-06-27 22:47:13 +03:00
parent 6afb9151fe
commit 421a94b195
1 changed files with 3 additions and 3 deletions

View File

@ -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