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

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

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

Visibility: public

Requested revision: 56c0a66ce30094d199420a3f2b2d2e759c1b0613

Requested commit: 56c0a66ce30094d199420a3f2b2d2e759c1b0613

Commit: 56c0a66ce30094d199420a3f2b2d2e759c1b0613

Tree: 6886f18e18b63384d5345ccd226dcb28cd2a0820

Author: LemonBoy

Committer: Veikka Tuominen

## 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

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

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