@@ -292,25 +292,11 @@ fn test_complex_arg() {
292292}
293293
294294fn test_complex_log () {
295- // Tests were also verified on Wolfram Alpha
296- mut c1 := cmplx.complex (5 , 7 )
297- mut b1 := cmplx.complex (- 6 , - 2 )
298- mut c2 := cmplx.complex (0.232873 , - 1.413175 )
299- mut result := c1 .log (b1 )
300- // Some issue with precision comparison in f64 using == operator hence serializing to string
301- assert result.str () == c2 .str ()
302- c1 = cmplx.complex (- 3 , 4 )
303- b1 = cmplx.complex (3 , - 1 )
304- c2 = cmplx.complex (0.152198 , - 0.409312 )
305- result = c1 .log (b1 )
306- // Some issue with precision comparison in f64 using == operator hence serializing to string
307- assert result.str () == c2 .str ()
308- c1 = cmplx.complex (- 1 , - 2 )
309- b1 = cmplx.complex (0 , 9 )
310- c2 = cmplx.complex (- 0.298243 , 1.197981 )
311- result = c1 .log (b1 )
312- // Some issue with precision comparison in f64 using == operator hence serializing to string
313- assert result.str () == c2 .str ()
295+ a := cmplx.complex (11.22 , 33.44 )
296+ b := cmplx.complex (55.66 , 77.88 )
297+ c := a.log (b)
298+ assert c.re.eq_epsilon (0.8032210844549097 )
299+ assert c.im.eq_epsilon (0.10605953671930149 )
314300}
315301
316302fn test_complex_cpow () {
0 commit comments