Renamed reverse to negate.
This commit is contained in:
parent
6afb9151fe
commit
421a94b195
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue