# Fix bug in exp2\(\) \(\#9999\) · gitcafe/zig

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

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

Visibility: public

Requested revision: f890de62948a0134a8d703dd2f1ee37701ec4c00

Requested commit: f890de62948a0134a8d703dd2f1ee37701ec4c00

Commit: f890de62948a0134a8d703dd2f1ee37701ec4c00

Tree: 5151dadec62428299befc0d21f3f1464c4402d0a

Author: Lewis Gaul

Committer: GitHub

## Message

```
Fix bug in exp2() (#9999)

* Fix bug in exp2_64 to handle negative values (bad translation from C)

* Apply fix to exp2_32() as well, and modify comment on musl behaviour

* Use +%= instead of @addWithOverflow()
```

## Parents

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

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