summaryrefslogtreecommitdiff
path: root/src/pkg/strconv/fp_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-11-09 21:23:52 -0800
committerRobert Griesemer <gri@golang.org>2009-11-09 21:23:52 -0800
commit9aad19327eb719775a874f8f18bb15958db1d471 (patch)
treec515081857e0b9ad897c6d35b0be64fe4c346688 /src/pkg/strconv/fp_test.go
parent073e240233589933c43143c997247c33206bb066 (diff)
downloadgolang-9aad19327eb719775a874f8f18bb15958db1d471.tar.gz
- replaced gofmt expression formatting algorithm with
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
Diffstat (limited to 'src/pkg/strconv/fp_test.go')
-rw-r--r--src/pkg/strconv/fp_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/strconv/fp_test.go b/src/pkg/strconv/fp_test.go
index 757041d33..8fee9f84c 100644
--- a/src/pkg/strconv/fp_test.go
+++ b/src/pkg/strconv/fp_test.go
@@ -16,13 +16,13 @@ import (
func pow2(i int) float64 {
switch {
case i < 0:
- return 1/pow2(-i)
+ return 1 / pow2(-i)
case i == 0:
return 1
case i == 1:
return 2
}
- return pow2(i/2)*pow2(i - i/2);
+ return pow2(i/2) * pow2(i-i/2);
}
// Wrapper around strconv.Atof64. Handles dddddp+ddd (binary exponent)
@@ -60,7 +60,7 @@ func myatof64(s string) (f float64, ok bool) {
}
return v, true;
}
- return v*pow2(e), true;
+ return v * pow2(e), true;
}
f1, err := strconv.Atof64(s);
if err != nil {
@@ -84,7 +84,7 @@ func myatof32(s string) (f float32, ok bool) {
println("bad p", a[1]);
return 0, false;
}
- return float32(float64(n)*pow2(e)), true;
+ return float32(float64(n) * pow2(e)), true;
}
f1, err1 := strconv.Atof32(s);
if err1 != nil {