diff options
| author | Marc Tiehuis <marctiehuis@gmail.com> | 2018-05-10 22:26:26 +1200 |
|---|---|---|
| committer | Marc Tiehuis <marctiehuis@gmail.com> | 2018-05-10 22:26:26 +1200 |
| commit | efa39c5343e13a13e65210f55da5df23ee3feb3e (patch) | |
| tree | 5bf359499baa56f4066165c135e382d3a9bb1f1e /src/bigint.cpp | |
| parent | c3ddf5069e0fb0b728ce275410988ccec3ab7ce9 (diff) | |
| download | zig-efa39c5343e13a13e65210f55da5df23ee3feb3e.tar.gz zig-efa39c5343e13a13e65210f55da5df23ee3feb3e.zip | |
Fix bigint shift-right partial shift
Diffstat (limited to 'src/bigint.cpp')
| -rw-r--r-- | src/bigint.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bigint.cpp b/src/bigint.cpp index 64bc59e5cf..367ae79b6c 100644 --- a/src/bigint.cpp +++ b/src/bigint.cpp @@ -1425,7 +1425,7 @@ void bigint_shr(BigInt *dest, const BigInt *op1, const BigInt *op2) { uint64_t digit = op1_digits[op_digit_index]; size_t dest_digit_index = op_digit_index - digit_shift_count; dest->data.digits[dest_digit_index] = carry | (digit >> leftover_shift_count); - carry = digit << leftover_shift_count; + carry = digit << (64 - leftover_shift_count); if (dest_digit_index == 0) { break; } op_digit_index -= 1; |
