diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-08-16 16:10:10 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-08-16 16:10:10 +0200 |
| commit | 8b49bbb0fca317a02cf6f14fa5c7c8784ea4076d (patch) | |
| tree | 3746915f507d2d7dccef97cd35a0f9eb386507ef /core/math/big/example.odin | |
| parent | 5f072591ba70abf6df59f4ed9372649e7ebda710 (diff) | |
big: Add `_private_mul_karatsuba`.
Diffstat (limited to 'core/math/big/example.odin')
| -rw-r--r-- | core/math/big/example.odin | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/core/math/big/example.odin b/core/math/big/example.odin index 4fbf44664..2a66251c9 100644 --- a/core/math/big/example.odin +++ b/core/math/big/example.odin @@ -206,16 +206,12 @@ demo :: proc() { a, b, c, d, e, f := &Int{}, &Int{}, &Int{}, &Int{}, &Int{}, &Int{}; defer destroy(a, b, c, d, e, f); - atoi(a, "12980742146337069150589594264770969721", 10); + power_of_two(a, 312); print("a: ", a, 10, true, true, true); - atoi(b, "4611686018427387904", 10); + power_of_two(b, 314); print("b: ", b, 10, true, true, true); - - if err := internal_divmod(c, d, a, b); err != nil { - fmt.printf("Error: %v\n", err); - } - print("c: ", c); - print("c: ", d); + _private_mul_karatsuba(c, a, b); + print("c: ", c, 10, true, true, true); } main :: proc() { |