big: Add _private_int_mul_toom`.

This commit is contained in:
Jeroen van Rijn
2021-08-16 21:17:21 +02:00
parent 8b49bbb0fc
commit 706e58c1c7
5 changed files with 150 additions and 9 deletions
+6 -3
View File
@@ -206,11 +206,14 @@ demo :: proc() {
a, b, c, d, e, f := &Int{}, &Int{}, &Int{}, &Int{}, &Int{}, &Int{};
defer destroy(a, b, c, d, e, f);
power_of_two(a, 312);
atoi(a, "615037959146039477924633848896619112832171971562900618409305032006863881436080", 10);
print("a: ", a, 10, true, true, true);
power_of_two(b, 314);
atoi(b, "378271691190525325893712245607881659587045836991909505715443874842659307597325888631898626653926188084180707310543535657996185416604973577488563643125766400", 10);
print("b: ", b, 10, true, true, true);
_private_mul_karatsuba(c, a, b);
// _private_mul_karatsuba(c, a, b);
_private_int_mul_toom(c, a, b);
// 232651448952541576870611266174879305550351371288854695862580414333123414997160350830885091499735909790287667499899722495800734048928379224433901855785208987458832826418636718381316545267329375006999278984386253755079362097682611712000
print("c: ", c, 10, true, true, true);
}