math: add functions; update tests and special cases
Added special cases to comments for asin.go and fabs.go.
Added Trunc() to floor.go and floor_386.s. Fixed formatting
error in hypot_386.s Added new functions Acosh, Asinh,
Atanh, Copysign, Erf, Erfc, Expm1, and Log1p. Added
386 FPU version of Fmod. Added tests, benchmarks, and
precision to expected results in all_test.go. Edited
makefile so it all compiles.
R=rsc
CC=golang-dev
https://golang.org/cl/195052
diff --git a/src/pkg/math/fabs.go b/src/pkg/math/fabs.go
index ca78f3b..fcddb85 100644
--- a/src/pkg/math/fabs.go
+++ b/src/pkg/math/fabs.go
@@ -5,6 +5,11 @@
package math
// Fabs returns the absolute value of x.
+//
+// Special cases are:
+// Fabs(+Inf) = +Inf
+// Fabs(-Inf) = +Inf
+// Fabs(NaN) = NaN
func Fabs(x float64) float64 {
if x < 0 {
return -x