Updated bigint.

This commit is contained in:
Christoffer Lerno
2024-10-02 01:13:34 +02:00
parent 9b49d19224
commit 607a625641
2 changed files with 85 additions and 65 deletions

View File

@@ -11,6 +11,17 @@ fn void test_plus()
assert(a.add(b).equals(bigint::from_int(12323400012311213314141414i128 + 23400012311213314141414i128)));
}
fn void test_mult()
{
BigInt a = bigint::from_int(123);
BigInt b = bigint::from_int(234);
assert(a.mult(b).equals(bigint::from_int(234 * 123)));
a = bigint::from_int(1232311213314141414i128);
b = bigint::from_int(234000123112414i128);
assert(a.mult(b).equals(bigint::from_int(1232311213314141414i128 * 234000123112414i128)));
}
fn void test_minus()
{
BigInt a = bigint::from_int(123);