# std: Fix tanh for negative inputs · gitcafe/zig

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

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

Visibility: public

Requested revision: a913311f3cf17c950facdf7aae16336fbdfbf8a9

Requested commit: a913311f3cf17c950facdf7aae16336fbdfbf8a9

Commit: a913311f3cf17c950facdf7aae16336fbdfbf8a9

Tree: 6d3efc9ee5c6057c62ec454363529310aa3121cd

Author: LemonBoy

Committer: Andrew Kelley

## Message

```
std: Fix tanh for negative inputs

It turns out the code was not ported correctly from C and produced wrong
results for negative input values. As a bonus fix the NaN codepath by
adding yet another missing piece of code.

Spotted in #9047

```

## Parents

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

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