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

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

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

Visibility: public

Requested revision: ed284c1f98ae08a36a7ef0776e22a4cfb2527fee

Requested commit: ed284c1f98ae08a36a7ef0776e22a4cfb2527fee

Commit: ed284c1f98ae08a36a7ef0776e22a4cfb2527fee

Tree: a8615a86badb18c304182fdb90f4ffd8065b2c80

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

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

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