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/helpers.odin | |
| parent | 5f072591ba70abf6df59f4ed9372649e7ebda710 (diff) | |
big: Add `_private_mul_karatsuba`.
Diffstat (limited to 'core/math/big/helpers.odin')
| -rw-r--r-- | core/math/big/helpers.odin | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/math/big/helpers.odin b/core/math/big/helpers.odin index ab686b914..e50579ac0 100644 --- a/core/math/big/helpers.odin +++ b/core/math/big/helpers.odin @@ -432,18 +432,16 @@ int_init_multi :: proc(integers: ..^Int, allocator := context.allocator) -> (err init_multi :: proc { int_init_multi, }; -copy_digits :: proc(dest, src: ^Int, digits: int, allocator := context.allocator) -> (err: Error) { +copy_digits :: proc(dest, src: ^Int, digits: int, offset := int(0), allocator := context.allocator) -> (err: Error) { context.allocator = allocator; - digits := digits; /* Check that `src` is usable and `dest` isn't immutable. */ assert_if_nil(dest, src); #force_inline internal_clear_if_uninitialized(src) or_return; - digits = min(digits, len(src.digit), len(dest.digit)); - return #force_inline internal_copy_digits(dest, src, digits); + return #force_inline internal_copy_digits(dest, src, digits, offset); } /* |