Karatsuba added, 2 bugs are fixed #328

Merged
zhelenskiy merged 15 commits from dev into dev 2021-05-14 09:12:26 +03:00
Showing only changes of commit 3ad7f32ada - Show all commits

View File

@ -56,8 +56,7 @@ public class BigInt internal constructor(
else -> sign * compareMagnitudes(magnitude, other.magnitude) else -> sign * compareMagnitudes(magnitude, other.magnitude)
} }
public override fun equals(other: Any?): Boolean = public override fun equals(other: Any?): Boolean = other is BigInt && compareTo(other) == 0
if (other is BigInt) compareTo(other) == 0 else error("Can't compare KBigInteger to a different type")
public override fun hashCode(): Int = magnitude.hashCode() + sign public override fun hashCode(): Int = magnitude.hashCode() + sign