| commit | 22f84c5b2a8fafac38f98c51a01786325524c1bc | [log] [tgz] |
|---|---|---|
| author | Charles L. Dorian <cldorian@gmail.com> | Mon Apr 26 22:44:39 2010 -0700 |
| committer | Russ Cox <rsc@golang.org> | Mon Apr 26 22:44:39 2010 -0700 |
| tree | 25e8245ea8c390e9260b396d55015a1db04b80e9 | |
| parent | d6e4e18c8c806653a0d007771dd75b965574e4fe [diff] [blame] |
math: more special cases for signed zero R=rsc CC=golang-dev https://golang.org/cl/937042
diff --git a/src/pkg/math/atan.go b/src/pkg/math/atan.go index 654fd4b..9d4ec2f 100644 --- a/src/pkg/math/atan.go +++ b/src/pkg/math/atan.go
@@ -47,7 +47,14 @@ } // Atan returns the arctangent of x. +// +// Special cases are: +// Atan(±0) = ±0 +// Atan(±Inf) = ±Pi/2 func Atan(x float64) float64 { + if x == 0 { + return x + } if x > 0 { return satan(x) }