(self)
| 367 | assert_almost_equal(y, y_r) |
| 368 | |
| 369 | def test_scalar(self): |
| 370 | x = np.array([1, 1j, 2, 2.5+.37j, np.inf, np.nan]) |
| 371 | y = np.array([1, 1j, -0.5+1.5j, -0.5+1.5j, 2, 3]) |
| 372 | lx = list(range(len(x))) |
| 373 | |
| 374 | # Hardcode the expected `builtins.complex` values, |
| 375 | # as complex exponentiation is broken as of bpo-44698 |
| 376 | p_r = [ |
| 377 | 1+0j, |
| 378 | 0.20787957635076193+0j, |
| 379 | 0.35812203996480685+0.6097119028618724j, |
| 380 | 0.12659112128185032+0.48847676699581527j, |
| 381 | complex(np.inf, np.nan), |
| 382 | complex(np.nan, np.nan), |
| 383 | ] |
| 384 | |
| 385 | n_r = [x[i] ** y[i] for i in lx] |
| 386 | for i in lx: |
| 387 | assert_almost_equal(n_r[i], p_r[i], err_msg='Loop %d\n' % i) |
| 388 | |
| 389 | def test_array(self): |
| 390 | x = np.array([1, 1j, 2, 2.5+.37j, np.inf, np.nan]) |
nothing calls this directly
no test coverage detected