summaryrefslogtreecommitdiff
path: root/src/pkg/math/all_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-01-11 11:25:37 -0800
committerRuss Cox <rsc@golang.org>2010-01-11 11:25:37 -0800
commit6de77b3decb69b0c806361740ab187339326cee0 (patch)
treeba592c0bd8be357ee2091fb25bad1c1c37664294 /src/pkg/math/all_test.go
parent2f5f107abb40e5b1867af40787404d155ad937ea (diff)
downloadgolang-6de77b3decb69b0c806361740ab187339326cee0.tar.gz
math: fix pow10 comment, test portable Sqrt
R=r CC= golang-dev, Charlie Dorian, golang-dev http://codereview.appspot.com/184058
Diffstat (limited to 'src/pkg/math/all_test.go')
-rw-r--r--src/pkg/math/all_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/pkg/math/all_test.go b/src/pkg/math/all_test.go
index 04c273322..7dcc41f41 100644
--- a/src/pkg/math/all_test.go
+++ b/src/pkg/math/all_test.go
@@ -307,7 +307,6 @@ func alike(a, b float64) bool {
func TestAcos(t *testing.T) {
for i := 0; i < len(vf); i++ {
- // if f := Acos(vf[i] / 10); !veryclose(acos[i], f) {
if f := Acos(vf[i] / 10); !close(acos[i], f) {
t.Errorf("Acos(%g) = %g, want %g\n", vf[i]/10, f, acos[i])
}
@@ -405,8 +404,12 @@ func TestSinh(t *testing.T) {
func TestSqrt(t *testing.T) {
for i := 0; i < len(vf); i++ {
a := Fabs(vf[i])
- if f := Sqrt(a); !veryclose(sqrt[i], f) {
- t.Errorf("Sqrt(%g) = %g, want %g\n", a, f, floor[i])
+ if f := SqrtGo(a); sqrt[i] != f {
+ t.Errorf("sqrtGo(%g) = %g, want %g\n", a, f, sqrt[i])
+ }
+ a = Fabs(vf[i])
+ if f := Sqrt(a); sqrt[i] != f {
+ t.Errorf("Sqrt(%g) = %g, want %g\n", a, f, sqrt[i])
}
}
}
@@ -430,7 +433,7 @@ func TestTanh(t *testing.T) {
func TestHypot(t *testing.T) {
for i := 0; i < len(vf); i++ {
a := Fabs(tanh[i] * Sqrt(2))
- if f := Hypot(tanh[i], tanh[i]); !veryclose(a, f) {
+ if f := Hypot(tanh[i], tanh[i]); a != f {
t.Errorf("Hypot(%g, %g) = %g, want %g\n", tanh[i], tanh[i], f, a)
}
}