Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e61e74f

Browse files
committed
TST: check for tanh(1000+0j) == 1 + 0j etc.
This is a test for the fix for numpygh-2321.
1 parent 5362b35 commit e61e74f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

numpy/core/tests/test_umath_complex.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,16 @@ def test_special_values(self):
517517
yield check_real_value, ncu._arg, np.nan, np.inf, np.nan, False
518518
yield check_real_value, ncu._arg, np.inf, np.nan, np.nan, False
519519

520+
class TestCtan(object):
521+
def test_simple(self):
522+
check_complex_value(ncu.tan, 0, 1000, 0, 1, True)
523+
check_complex_value(ncu.tan, 0, -1000, 0, -1, True)
524+
525+
class TestCtanh(object):
526+
def test_simple(self):
527+
check_complex_value(ncu.tanh, 1000, 0, 1, 0, True)
528+
check_complex_value(ncu.tanh, -1000, 0, -1, 0, True)
529+
520530
def check_real_value(f, x1, y1, x, exact=True):
521531
z1 = np.array([complex(x1, y1)])
522532
if exact:

0 commit comments

Comments
 (0)