File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
- // Copyright 2009 The Go Authors. All rights reserved.
1
+ // Copyright 2020 The Go Authors. All rights reserved.
2
2
// Use of this source code is governed by a BSD-style
3
3
// license that can be found in the LICENSE file.
4
4
@@ -27,15 +27,15 @@ package strconv
27
27
// The special precision -1 uses the smallest number of digits
28
28
// necessary such that ParseComplex will return c exactly.
29
29
func FormatComplex (c complex128 , fmt byte , prec , bitSize int ) string {
30
-
31
30
if bitSize == 64 {
32
31
bitSize = 32
33
32
} else {
34
33
bitSize = 64
35
34
}
36
35
36
+ // Check if imaginary part has a sign. If not, add one.
37
37
imag := FormatFloat (imag (c ), fmt , prec , bitSize )
38
- if imag [0 : 1 ] != "+" && imag [0 : 1 ] != "-" {
38
+ if imag [0 ] != '+' && imag [0 ] != '-' {
39
39
imag = "+" + imag
40
40
}
41
41
You can’t perform that action at this time.
0 commit comments