From e2f8d236cc5a8eebd3cbd1bade0e24a83e5ad007 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Tue, 4 Oct 2022 22:21:58 -0700 Subject: [PATCH] Minor cleanup. I almost can't believe I did it. I guess I thought it would be harder or more involved. Maybe divmod will be a pill? Kinda relaxing after wasting the weekend nerd-sniped by curses. --- bigjoyints/big.py | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/bigjoyints/big.py b/bigjoyints/big.py index 47109a8..805ab36 100755 --- a/bigjoyints/big.py +++ b/bigjoyints/big.py @@ -87,36 +87,8 @@ class BigInt: def __mul__(self, other): if not isinstance(other, BigInt): other = BigInt(other) - if len(self.digits) < len(other.digits): return other.__mul__(self) - - # We now multiple the digits of self by the digits of other. - # - # 128 - # * 12 - # ------ - # - # 128 - # * 2 - # ------ - # 8 - # 2 - # - - # 16 - # 2| - # 2| - # -| - # 46 - # carry1 - # 56 - # 1|| - # 2|| - # -|| - # 256 - # - # Hmm... - acc = BigInt() for i, digit in enumerate(other.digits): acc = acc + self._mul_one_digit(i, digit)