diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-09-24 14:37:55 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-09-24 14:38:51 -0400 |
| commit | 32c91ad892f5dc0138828aea19b3c0e2b062d168 (patch) | |
| tree | 03d8101eff6e5340ccce1b3f39179465dcc2d240 /src/bigint.cpp | |
| parent | 422269ea6e49409464fd1fd00212fc7f7681a5e0 (diff) | |
| download | zig-32c91ad892f5dc0138828aea19b3c0e2b062d168.tar.gz zig-32c91ad892f5dc0138828aea19b3c0e2b062d168.zip | |
fix comptime bitwise operations with negative values
closes #1387
closes #1529
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 bf18b9a1bf..2737057f97 100644 --- a/src/bigint.cpp +++ b/src/bigint.cpp @@ -50,7 +50,7 @@ size_t bigint_bits_needed(const BigInt *op) { size_t full_bits = op->digit_count * 64; size_t leading_zero_count = bigint_clz(op, full_bits); size_t bits_needed = full_bits - leading_zero_count; - return bits_needed + op->is_negative; + return bits_needed; } static void to_twos_complement(BigInt *dest, const BigInt *op, size_t bit_count) { |
