diff options
Diffstat (limited to 'src/pkg/math/tanh.go')
-rw-r--r-- | src/pkg/math/tanh.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/math/tanh.go b/src/pkg/math/tanh.go index 93c68a6e4..144c08530 100644 --- a/src/pkg/math/tanh.go +++ b/src/pkg/math/tanh.go @@ -16,14 +16,14 @@ package math // Tanh computes the hyperbolic tangent of x. func Tanh(x float64) float64 { if x < 0 { - x = -x; + x = -x if x > 21 { return -1 } - return -Sinh(x) / Cosh(x); + return -Sinh(x) / Cosh(x) } if x > 21 { return 1 } - return Sinh(x) / Cosh(x); + return Sinh(x) / Cosh(x) } |