From 3f86505897e378c863013c5585bba82c348f1eac Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 06:54:06 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- maths/addition_without_arithmetic.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/maths/addition_without_arithmetic.py b/maths/addition_without_arithmetic.py index 4d76a695e..0439d65de 100644 --- a/maths/addition_without_arithmetic.py +++ b/maths/addition_without_arithmetic.py @@ -15,11 +15,12 @@ def add(first: int, second: int) -> int: -321 """ while second != 0: - carry = first & second # Calculate carry - first = first ^ second # Add without carry - second = carry << 1 # Prepare carry for next iteration + carry = first & second # Calculate carry + first = first ^ second # Add without carry + second = carry << 1 # Prepare carry for next iteration return first + if __name__ == "__main__": import doctest