Skip to content

Commit 23ae2de

Browse files
committed
Log output instead of using Dump
1 parent 92e1ad2 commit 23ae2de

File tree

1 file changed

+18
-35
lines changed

1 file changed

+18
-35
lines changed

cmplx_test.go

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,99 @@
11
package gfx
22

33
func ExampleCmplxSin() {
4-
Dump(
4+
Log("%f %f %f",
55
CmplxSin(complex(1, 2)),
66
CmplxSin(complex(2, 3)),
77
CmplxSin(complex(4, 5)),
88
)
99

1010
// Output:
11-
// (3.165778513216168+1.9596010414216063i)
12-
// (9.154499146911428-4.168906959966565i)
13-
// (-56.16227422023235-48.50245524177091i)
11+
// (3.165779+1.959601i) (9.154499-4.168907i) (-56.162274-48.502455i)
1412
}
1513

1614
func ExampleCmplxSinh() {
17-
Dump(
15+
Log("%f %f %f",
1816
CmplxSinh(complex(1, 2)),
1917
CmplxSinh(complex(2, 3)),
2018
CmplxSinh(complex(4, 5)),
2119
)
2220

2321
// Output:
24-
// (-0.4890562590412937+1.4031192506220405i)
25-
// (-3.59056458998578+0.5309210862485197i)
26-
// (7.741117553247741-26.18652736460921i)
22+
// (-0.489056+1.403119i) (-3.590565+0.530921i) (7.741118-26.186527i)
2723
}
2824

2925
func ExampleCmplxCos() {
30-
Dump(
26+
Log("%f %f %f",
3127
CmplxCos(complex(1, 2)),
3228
CmplxCos(complex(2, 3)),
3329
CmplxCos(complex(4, 5)),
3430
)
3531

3632
// Output:
37-
// (2.0327230070196656-3.0518977991518i)
38-
// (-4.189625690968807-9.109227893755337i)
39-
// (-48.506859457844584+56.15717492513018i)
33+
// (2.032723-3.051898i) (-4.189626-9.109228i) (-48.506859+56.157175i)
4034
}
4135

4236
func ExampleCmplxCosh() {
43-
Dump(
37+
Log("%f %f %f",
4438
CmplxCosh(complex(1, 2)),
4539
CmplxCosh(complex(2, 3)),
4640
CmplxCosh(complex(4, 5)),
4741
)
4842

4943
// Output:
50-
// (-0.64214812471552+1.068607421382778i)
51-
// (-3.7245455049153224+0.5118225699873846i)
52-
// (7.746313007403075-26.168964053872834i)
44+
// (-0.642148+1.068607i) (-3.724546+0.511823i) (7.746313-26.168964i)
5345
}
5446

5547
func ExampleCmplxTan() {
56-
Dump(
48+
Log("%f %f %f",
5749
CmplxTan(complex(1, 2)),
5850
CmplxTan(complex(2, 3)),
5951
CmplxTan(complex(4, 5)),
6052
)
6153

6254
// Output:
63-
// (0.033812826079896684+1.0147936161466335i)
64-
// (-0.0037640256415042484+1.0032386273536098i)
65-
// (8.983477646971559e-05+1.0000132074347845i)
55+
// (0.033813+1.014794i) (-0.003764+1.003239i) (0.000090+1.000013i)
6656
}
6757

6858
func ExampleCmplxTanh() {
69-
Dump(
59+
Log("%f %f %f",
7060
CmplxTanh(complex(1, 2)),
7161
CmplxTanh(complex(2, 3)),
7262
CmplxTanh(complex(4, 5)),
7363
)
7464

7565
// Output:
76-
// (1.16673625724092-0.24345820118572523i)
77-
// (0.965385879022133-0.009884375038322494i)
78-
// (1.0005630461157933-0.00036520305451130414i)
66+
// (1.166736-0.243458i) (0.965386-0.009884i) (1.000563-0.000365i)
7967
}
8068

8169
func ExampleCmplxPow() {
82-
Dump(
70+
Log("%f %f",
8371
CmplxPow(complex(1, 2), complex(2, 3)),
8472
CmplxPow(complex(4, 5), complex(5, 6)),
8573
)
8674

8775
// Output:
88-
// (-0.015132672422722659-0.179867483913335i)
89-
// (-49.59108992764897+4.323851372977011i)
76+
// (-0.015133-0.179867i) (-49.591090+4.323851i)
9077
}
9178

9279
func ExampleCmplxSqrt() {
93-
Dump(
80+
Log("%f %f %f",
9481
CmplxSqrt(complex(1, 2)),
9582
CmplxSqrt(complex(2, 3)),
9683
CmplxSqrt(complex(4, 5)),
9784
)
9885

9986
// Output:
100-
// (1.272019649514069+0.7861513777574233i)
101-
// (1.6741492280355401+0.8959774761298381i)
102-
// (2.280693341665298+1.096157889501519i)
87+
// (1.272020+0.786151i) (1.674149+0.895977i) (2.280693+1.096158i)
10388
}
10489

10590
func ExampleCmplxPhase() {
106-
Dump(
91+
Log("%f %f %f",
10792
CmplxPhase(complex(1, 2)),
10893
CmplxPhase(complex(2, 3)),
10994
CmplxPhase(complex(4, 5)),
11095
)
11196

11297
// Output:
113-
// 1.1071487177940904
114-
// 0.982793723247329
115-
// 0.8960553845713439
98+
// 1.107149 0.982794 0.896055
11699
}

0 commit comments

Comments
 (0)