1) Change default gofmt default settings for
parsing and printing to new syntax.
Use -oldparser to parse the old syntax,
use -oldprinter to print the old syntax.
2) Change default gofmt formatting settings
to use tabs for indentation only and to use
spaces for alignment. This will make the code
alignment insensitive to an editor's tabwidth.
Use -spaces=false to use tabs for alignment.
3) Manually changed src/exp/parser/parser_test.go
so that it doesn't try to parse the parser's
source files using the old syntax (they have
new syntax now).
4) gofmt -w src misc test/bench
3rd set of files.
R=rsc
CC=golang-dev
https://golang.org/cl/180048
diff --git a/src/pkg/math/log.go b/src/pkg/math/log.go
index e926501..0564689 100644
--- a/src/pkg/math/log.go
+++ b/src/pkg/math/log.go
@@ -76,15 +76,15 @@
// Log(NaN) = NaN
func Log(x float64) float64 {
const (
- Ln2Hi = 6.93147180369123816490e-01; /* 3fe62e42 fee00000 */
- Ln2Lo = 1.90821492927058770002e-10; /* 3dea39ef 35793c76 */
- L1 = 6.666666666666735130e-01; /* 3FE55555 55555593 */
- L2 = 3.999999999940941908e-01; /* 3FD99999 9997FA04 */
- L3 = 2.857142874366239149e-01; /* 3FD24924 94229359 */
- L4 = 2.222219843214978396e-01; /* 3FCC71C5 1D8E78AF */
- L5 = 1.818357216161805012e-01; /* 3FC74664 96CB03DE */
- L6 = 1.531383769920937332e-01; /* 3FC39A09 D078C69F */
- L7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
+ Ln2Hi = 6.93147180369123816490e-01 /* 3fe62e42 fee00000 */
+ Ln2Lo = 1.90821492927058770002e-10 /* 3dea39ef 35793c76 */
+ L1 = 6.666666666666735130e-01 /* 3FE55555 55555593 */
+ L2 = 3.999999999940941908e-01 /* 3FD99999 9997FA04 */
+ L3 = 2.857142874366239149e-01 /* 3FD24924 94229359 */
+ L4 = 2.222219843214978396e-01 /* 3FCC71C5 1D8E78AF */
+ L5 = 1.818357216161805012e-01 /* 3FC74664 96CB03DE */
+ L6 = 1.531383769920937332e-01 /* 3FC39A09 D078C69F */
+ L7 = 1.479819860511658591e-01 /* 3FC2F112 DF3E5244 */
)
// special cases
@@ -98,23 +98,23 @@
}
// reduce
- f1, ki := Frexp(x);
+ f1, ki := Frexp(x)
if f1 < Sqrt2/2 {
- f1 *= 2;
- ki--;
+ f1 *= 2
+ ki--
}
- f := f1 - 1;
- k := float64(ki);
+ f := f1 - 1
+ k := float64(ki)
// compute
- s := f / (2 + f);
- s2 := s * s;
- s4 := s2 * s2;
- t1 := s2 * (L1 + s4*(L3+s4*(L5+s4*L7)));
- t2 := s4 * (L2 + s4*(L4+s4*L6));
- R := t1 + t2;
- hfsq := 0.5 * f * f;
- return k*Ln2Hi - ((hfsq - (s*(hfsq+R) + k*Ln2Lo)) - f);
+ s := f / (2 + f)
+ s2 := s * s
+ s4 := s2 * s2
+ t1 := s2 * (L1 + s4*(L3+s4*(L5+s4*L7)))
+ t2 := s4 * (L2 + s4*(L4+s4*L6))
+ R := t1 + t2
+ hfsq := 0.5 * f * f
+ return k*Ln2Hi - ((hfsq - (s*(hfsq+R) + k*Ln2Lo)) - f)
}
// Log10 returns the decimal logarithm of x.
@@ -123,5 +123,5 @@
if x <= 0 {
return NaN()
}
- return Log(x) * (1 / Ln10);
+ return Log(x) * (1 / Ln10)
}