'Tests the sinc() function.
This test is purely to assert numerical computations are correct.'

def test_sinc(self):

    isoz = True
    tol = 'eps'
    pyfunc = sinc
    def check(x_types, x_values, **kwargs):
        self.run_unary(pyfunc, x_types, x_values, ignore_sign_on_zero=isoz, abs_tol=tol, **kwargs)
    x_values = [1.0, (-1.0), 0.0, (-0.0), 0.5, (-0.5), 5, (-5), 5e-21, (-5e-21)]
    x_types = ([types.float32, types.float64] * (len(x_values) // 2))
    check(x_types, x_values)
    x_values = [np.array(x_values, dtype=np.float64)]
    x_types = [typeof(v) for v in x_values]
    check(x_types, x_values)
    x_values = [(1.0 + 0j), ((-1) + 0j), (0.0 + 0j), ((-0.0) + 0j), (0 + 1j), (0 - 1j), (0.5 + 0j), ((-0.5) + 0j), (0.5 + 0.5j), ((-0.5) - 0.5j), (5 + 5j), ((-5) - 5j), (5e-21 + 0j), ((-5e-21) + 0j), 5e-21j, (+ (0 - 5e-21j))]
    x_types = ([types.complex64, types.complex128] * (len(x_values) // 2))
    check(x_types, x_values, ulps=2)
    x_values = [np.array(x_values, dtype=np.complex128)]
    x_types = [typeof(v) for v in x_values]
    check(x_types, x_values, ulps=2)
