Skip to content

Commit fae44a2

Browse files
committed
src, misc: apply gofmt
This applies the new gofmt literal normalizations to the library. Change-Id: I8c1e8ef62eb556fc568872c9f77a31ef236348e7 Reviewed-on: https://go-review.googlesource.com/c/162539 Run-TryBot: Robert Griesemer <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent f8abdd6 commit fae44a2

File tree

11 files changed

+75
-75
lines changed

11 files changed

+75
-75
lines changed

src/archive/tar/strconv.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func formatPAXTime(ts time.Time) (s string) {
244244
if secs < 0 {
245245
sign = "-" // Remember sign
246246
secs = -(secs + 1) // Add a second to secs
247-
nsecs = -(nsecs - 1E9) // Take that second away from nsecs
247+
nsecs = -(nsecs - 1e9) // Take that second away from nsecs
248248
}
249249
return strings.TrimRight(fmt.Sprintf("%s%d.%09d", sign, secs, nsecs), "0")
250250
}

src/archive/tar/strconv_test.go

+21-21
Original file line numberDiff line numberDiff line change
@@ -303,27 +303,27 @@ func TestFormatPAXTime(t *testing.T) {
303303
{1350244992, 300000000, "1350244992.3"},
304304
{1350244992, 23960100, "1350244992.0239601"},
305305
{1350244992, 23960108, "1350244992.023960108"},
306-
{+1, +1E9 - 1E0, "1.999999999"},
307-
{+1, +1E9 - 1E3, "1.999999"},
308-
{+1, +1E9 - 1E6, "1.999"},
309-
{+1, +0E0 - 0E0, "1"},
310-
{+1, +1E6 - 0E0, "1.001"},
311-
{+1, +1E3 - 0E0, "1.000001"},
312-
{+1, +1E0 - 0E0, "1.000000001"},
313-
{0, 1E9 - 1E0, "0.999999999"},
314-
{0, 1E9 - 1E3, "0.999999"},
315-
{0, 1E9 - 1E6, "0.999"},
316-
{0, 0E0, "0"},
317-
{0, 1E6 + 0E0, "0.001"},
318-
{0, 1E3 + 0E0, "0.000001"},
319-
{0, 1E0 + 0E0, "0.000000001"},
320-
{-1, -1E9 + 1E0, "-1.999999999"},
321-
{-1, -1E9 + 1E3, "-1.999999"},
322-
{-1, -1E9 + 1E6, "-1.999"},
323-
{-1, -0E0 + 0E0, "-1"},
324-
{-1, -1E6 + 0E0, "-1.001"},
325-
{-1, -1E3 + 0E0, "-1.000001"},
326-
{-1, -1E0 + 0E0, "-1.000000001"},
306+
{+1, +1e9 - 1e0, "1.999999999"},
307+
{+1, +1e9 - 1e3, "1.999999"},
308+
{+1, +1e9 - 1e6, "1.999"},
309+
{+1, +0e0 - 0e0, "1"},
310+
{+1, +1e6 - 0e0, "1.001"},
311+
{+1, +1e3 - 0e0, "1.000001"},
312+
{+1, +1e0 - 0e0, "1.000000001"},
313+
{0, 1e9 - 1e0, "0.999999999"},
314+
{0, 1e9 - 1e3, "0.999999"},
315+
{0, 1e9 - 1e6, "0.999"},
316+
{0, 0e0, "0"},
317+
{0, 1e6 + 0e0, "0.001"},
318+
{0, 1e3 + 0e0, "0.000001"},
319+
{0, 1e0 + 0e0, "0.000000001"},
320+
{-1, -1e9 + 1e0, "-1.999999999"},
321+
{-1, -1e9 + 1e3, "-1.999999"},
322+
{-1, -1e9 + 1e6, "-1.999"},
323+
{-1, -0e0 + 0e0, "-1"},
324+
{-1, -1e6 + 0e0, "-1.001"},
325+
{-1, -1e3 + 0e0, "-1.000001"},
326+
{-1, -1e0 + 0e0, "-1.000000001"},
327327
{-1350244992, 0, "-1350244992"},
328328
{-1350244992, -300000000, "-1350244992.3"},
329329
{-1350244992, -23960100, "-1350244992.0239601"},

src/cmd/compile/internal/gc/testdata/fp_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func integer2floatConversions(t *testing.T) {
179179
}
180180
{
181181
// Check maximum values
182-
a, b, c, d, e, f, g, h, i := conv2Float64_ssa(127, 255, 32767, 65535, 0x7fffffff, 0xffffffff, 0x7fffFFFFffffFFFF, 0xffffFFFFffffFFFF, 3.402823E38)
182+
a, b, c, d, e, f, g, h, i := conv2Float64_ssa(127, 255, 32767, 65535, 0x7fffffff, 0xffffffff, 0x7fffFFFFffffFFFF, 0xffffFFFFffffFFFF, 3.402823e38)
183183
expect64(t, "a", a, 127)
184184
expect64(t, "b", b, 255)
185185
expect64(t, "c", c, 32767)
@@ -188,11 +188,11 @@ func integer2floatConversions(t *testing.T) {
188188
expect64(t, "f", f, float64(uint32(0xffffffff)))
189189
expect64(t, "g", g, float64(int64(0x7fffffffffffffff)))
190190
expect64(t, "h", h, float64(uint64(0xffffffffffffffff)))
191-
expect64(t, "i", i, float64(float32(3.402823E38)))
191+
expect64(t, "i", i, float64(float32(3.402823e38)))
192192
}
193193
{
194194
// Check minimum values (and tweaks for unsigned)
195-
a, b, c, d, e, f, g, h, i := conv2Float64_ssa(-128, 254, -32768, 65534, ^0x7fffffff, 0xfffffffe, ^0x7fffFFFFffffFFFF, 0xffffFFFFffffF401, 1.5E-45)
195+
a, b, c, d, e, f, g, h, i := conv2Float64_ssa(-128, 254, -32768, 65534, ^0x7fffffff, 0xfffffffe, ^0x7fffFFFFffffFFFF, 0xffffFFFFffffF401, 1.5e-45)
196196
expect64(t, "a", a, -128)
197197
expect64(t, "b", b, 254)
198198
expect64(t, "c", c, -32768)
@@ -201,11 +201,11 @@ func integer2floatConversions(t *testing.T) {
201201
expect64(t, "f", f, float64(uint32(0xfffffffe)))
202202
expect64(t, "g", g, float64(^int64(0x7fffffffffffffff)))
203203
expect64(t, "h", h, float64(uint64(0xfffffffffffff401)))
204-
expect64(t, "i", i, float64(float32(1.5E-45)))
204+
expect64(t, "i", i, float64(float32(1.5e-45)))
205205
}
206206
{
207207
// Check maximum values
208-
a, b, c, d, e, f, g, h, i := conv2Float32_ssa(127, 255, 32767, 65535, 0x7fffffff, 0xffffffff, 0x7fffFFFFffffFFFF, 0xffffFFFFffffFFFF, 3.402823E38)
208+
a, b, c, d, e, f, g, h, i := conv2Float32_ssa(127, 255, 32767, 65535, 0x7fffffff, 0xffffffff, 0x7fffFFFFffffFFFF, 0xffffFFFFffffFFFF, 3.402823e38)
209209
expect32(t, "a", a, 127)
210210
expect32(t, "b", b, 255)
211211
expect32(t, "c", c, 32767)
@@ -214,11 +214,11 @@ func integer2floatConversions(t *testing.T) {
214214
expect32(t, "f", f, float32(uint32(0xffffffff)))
215215
expect32(t, "g", g, float32(int64(0x7fffffffffffffff)))
216216
expect32(t, "h", h, float32(uint64(0xffffffffffffffff)))
217-
expect32(t, "i", i, float32(float64(3.402823E38)))
217+
expect32(t, "i", i, float32(float64(3.402823e38)))
218218
}
219219
{
220220
// Check minimum values (and tweaks for unsigned)
221-
a, b, c, d, e, f, g, h, i := conv2Float32_ssa(-128, 254, -32768, 65534, ^0x7fffffff, 0xfffffffe, ^0x7fffFFFFffffFFFF, 0xffffFFFFffffF401, 1.5E-45)
221+
a, b, c, d, e, f, g, h, i := conv2Float32_ssa(-128, 254, -32768, 65534, ^0x7fffffff, 0xfffffffe, ^0x7fffFFFFffffFFFF, 0xffffFFFFffffF401, 1.5e-45)
222222
expect32(t, "a", a, -128)
223223
expect32(t, "b", b, 254)
224224
expect32(t, "c", c, -32768)
@@ -227,7 +227,7 @@ func integer2floatConversions(t *testing.T) {
227227
expect32(t, "f", f, float32(uint32(0xfffffffe)))
228228
expect32(t, "g", g, float32(^int64(0x7fffffffffffffff)))
229229
expect32(t, "h", h, float32(uint64(0xfffffffffffff401)))
230-
expect32(t, "i", i, float32(float64(1.5E-45)))
230+
expect32(t, "i", i, float32(float64(1.5e-45)))
231231
}
232232
}
233233

@@ -1685,7 +1685,7 @@ func TestFP(t *testing.T) {
16851685
c := float32(3.0)
16861686
d := float32(4.0)
16871687

1688-
tiny := float32(1.5E-45) // smallest f32 denorm = 2**(-149)
1688+
tiny := float32(1.5e-45) // smallest f32 denorm = 2**(-149)
16891689
dtiny := float64(tiny) // well within range of f64
16901690

16911691
fail64("+", add64_ssa, a, b, 7.0)

src/cmd/vendor/golang.org/x/sys/windows/security_windows.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/compress/flate/deflate_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func TestVeryLongSparseChunk(t *testing.T) {
161161
t.Errorf("NewWriter: %v", err)
162162
return
163163
}
164-
if _, err = io.Copy(w, &sparseReader{l: 23E8}); err != nil {
164+
if _, err = io.Copy(w, &sparseReader{l: 23e8}); err != nil {
165165
t.Errorf("Compress failed: %v", err)
166166
return
167167
}

src/go/internal/gcimporter/testdata/exports.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const (
1919
C1 = 3.14159265
2020
C2 = 2.718281828i
2121
C3 = -123.456e-789
22-
C4 = +123.456E+789
22+
C4 = +123.456e+789
2323
C5 = 1234i
2424
C6 = "foo\n"
2525
C7 = `bar\n`

src/math/cmplx/tan.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ func Tanh(x complex128) complex128 {
9292
func reducePi(x float64) float64 {
9393
const (
9494
// extended precision value of PI:
95-
DP1 = 3.14159265160560607910E0 // ?? 0x400921fb54000000
96-
DP2 = 1.98418714791870343106E-9 // ?? 0x3e210b4610000000
97-
DP3 = 1.14423774522196636802E-17 // ?? 0x3c6a62633145c06e
95+
DP1 = 3.14159265160560607910e0 // ?? 0x400921fb54000000
96+
DP2 = 1.98418714791870343106e-9 // ?? 0x3e210b4610000000
97+
DP3 = 1.14423774522196636802e-17 // ?? 0x3c6a62633145c06e
9898
)
9999
t := x / math.Pi
100100
if t >= 0 {

src/math/sin.go

+18-18
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,22 @@ package math
9191

9292
// sin coefficients
9393
var _sin = [...]float64{
94-
1.58962301576546568060E-10, // 0x3de5d8fd1fd19ccd
95-
-2.50507477628578072866E-8, // 0xbe5ae5e5a9291f5d
96-
2.75573136213857245213E-6, // 0x3ec71de3567d48a1
97-
-1.98412698295895385996E-4, // 0xbf2a01a019bfdf03
98-
8.33333333332211858878E-3, // 0x3f8111111110f7d0
99-
-1.66666666666666307295E-1, // 0xbfc5555555555548
94+
1.58962301576546568060e-10, // 0x3de5d8fd1fd19ccd
95+
-2.50507477628578072866e-8, // 0xbe5ae5e5a9291f5d
96+
2.75573136213857245213e-6, // 0x3ec71de3567d48a1
97+
-1.98412698295895385996e-4, // 0xbf2a01a019bfdf03
98+
8.33333333332211858878e-3, // 0x3f8111111110f7d0
99+
-1.66666666666666307295e-1, // 0xbfc5555555555548
100100
}
101101

102102
// cos coefficients
103103
var _cos = [...]float64{
104-
-1.13585365213876817300E-11, // 0xbda8fa49a0861a9b
105-
2.08757008419747316778E-9, // 0x3e21ee9d7b4e3f05
106-
-2.75573141792967388112E-7, // 0xbe927e4f7eac4bc6
107-
2.48015872888517045348E-5, // 0x3efa01a019c844f5
108-
-1.38888888888730564116E-3, // 0xbf56c16c16c14f91
109-
4.16666666666665929218E-2, // 0x3fa555555555554b
104+
-1.13585365213876817300e-11, // 0xbda8fa49a0861a9b
105+
2.08757008419747316778e-9, // 0x3e21ee9d7b4e3f05
106+
-2.75573141792967388112e-7, // 0xbe927e4f7eac4bc6
107+
2.48015872888517045348e-5, // 0x3efa01a019c844f5
108+
-1.38888888888730564116e-3, // 0xbf56c16c16c14f91
109+
4.16666666666665929218e-2, // 0x3fa555555555554b
110110
}
111111

112112
// Cos returns the cosine of the radian argument x.
@@ -118,9 +118,9 @@ func Cos(x float64) float64
118118

119119
func cos(x float64) float64 {
120120
const (
121-
PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts
122-
PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000,
123-
PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170,
121+
PI4A = 7.85398125648498535156e-1 // 0x3fe921fb40000000, Pi/4 split into three parts
122+
PI4B = 3.77489470793079817668e-8 // 0x3e64442d00000000,
123+
PI4C = 2.69515142907905952645e-15 // 0x3ce8469898cc5170,
124124
)
125125
// special cases
126126
switch {
@@ -179,9 +179,9 @@ func Sin(x float64) float64
179179

180180
func sin(x float64) float64 {
181181
const (
182-
PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts
183-
PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000,
184-
PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170,
182+
PI4A = 7.85398125648498535156e-1 // 0x3fe921fb40000000, Pi/4 split into three parts
183+
PI4B = 3.77489470793079817668e-8 // 0x3e64442d00000000,
184+
PI4C = 2.69515142907905952645e-15 // 0x3ce8469898cc5170,
185185
)
186186
// special cases
187187
switch {

src/math/sincos.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ package math
1414
// Sincos(NaN) = NaN, NaN
1515
func Sincos(x float64) (sin, cos float64) {
1616
const (
17-
PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts
18-
PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000,
19-
PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170,
17+
PI4A = 7.85398125648498535156e-1 // 0x3fe921fb40000000, Pi/4 split into three parts
18+
PI4B = 3.77489470793079817668e-8 // 0x3e64442d00000000,
19+
PI4C = 2.69515142907905952645e-15 // 0x3ce8469898cc5170,
2020
)
2121
// special cases
2222
switch {

src/math/tan.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ package math
6161

6262
// tan coefficients
6363
var _tanP = [...]float64{
64-
-1.30936939181383777646E4, // 0xc0c992d8d24f3f38
65-
1.15351664838587416140E6, // 0x413199eca5fc9ddd
66-
-1.79565251976484877988E7, // 0xc1711fead3299176
64+
-1.30936939181383777646e4, // 0xc0c992d8d24f3f38
65+
1.15351664838587416140e6, // 0x413199eca5fc9ddd
66+
-1.79565251976484877988e7, // 0xc1711fead3299176
6767
}
6868
var _tanQ = [...]float64{
69-
1.00000000000000000000E0,
70-
1.36812963470692954678E4, //0x40cab8a5eeb36572
71-
-1.32089234440210967447E6, //0xc13427bc582abc96
72-
2.50083801823357915839E7, //0x4177d98fc2ead8ef
73-
-5.38695755929454629881E7, //0xc189afe03cbe5a31
69+
1.00000000000000000000e0,
70+
1.36812963470692954678e4, //0x40cab8a5eeb36572
71+
-1.32089234440210967447e6, //0xc13427bc582abc96
72+
2.50083801823357915839e7, //0x4177d98fc2ead8ef
73+
-5.38695755929454629881e7, //0xc189afe03cbe5a31
7474
}
7575

7676
// Tan returns the tangent of the radian argument x.
@@ -83,9 +83,9 @@ func Tan(x float64) float64
8383

8484
func tan(x float64) float64 {
8585
const (
86-
PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts
87-
PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000,
88-
PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170,
86+
PI4A = 7.85398125648498535156e-1 // 0x3fe921fb40000000, Pi/4 split into three parts
87+
PI4B = 3.77489470793079817668e-8 // 0x3e64442d00000000,
88+
PI4C = 2.69515142907905952645e-15 // 0x3ce8469898cc5170,
8989
)
9090
// special cases
9191
switch {

src/math/tanh.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ package math
5555
//
5656

5757
var tanhP = [...]float64{
58-
-9.64399179425052238628E-1,
59-
-9.92877231001918586564E1,
60-
-1.61468768441708447952E3,
58+
-9.64399179425052238628e-1,
59+
-9.92877231001918586564e1,
60+
-1.61468768441708447952e3,
6161
}
6262
var tanhQ = [...]float64{
63-
1.12811678491632931402E2,
64-
2.23548839060100448583E3,
65-
4.84406305325125486048E3,
63+
1.12811678491632931402e2,
64+
2.23548839060100448583e3,
65+
4.84406305325125486048e3,
6666
}
6767

6868
// Tanh returns the hyperbolic tangent of x.

0 commit comments

Comments
 (0)