# big.int: fix yet another truncate bug · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/4f47be5c6bbf67ed6812978759307d5d6de041ba)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 4f47be5c6bbf67ed6812978759307d5d6de041ba

Requested commit: 4f47be5c6bbf67ed6812978759307d5d6de041ba

Commit: 4f47be5c6bbf67ed6812978759307d5d6de041ba

Tree: 9a92f24e9df8fbb913f26cce4a593712f040964c

Author: Jacob Young

Committer: Jacob Young

## Message

```
big.int: fix yet another truncate bug

Too many bugs have been found with `truncate` at this point, so it was
rewritten from scratch.

Based on the doc comment, the utility of `convertToTwosComplement` over
`r.truncate(a, .unsigned, bit_count)` is unclear and it has a subtle
behavior difference that is almost certainly a bug, so it was deleted.

```

## Parents

- [7199a86b9776a0d44e9fceb98ac6567eb6db3d6e](https://git.cafe/gitcafe/zig/commit/7199a86b9776a0d44e9fceb98ac6567eb6db3d6e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/4f47be5c6bbf67ed6812978759307d5d6de041ba?format=markdown)
