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)
 	}