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

def test_angle(self, flags=no_pyobj_flags):

    pyfunc1 = angle1
    pyfunc2 = angle2
    def check(x_types, x_values):
        self.run_unary(pyfunc1, x_types, x_values)
        xtra_values = [(True,), (False,)]
        xtra_types = ([(types.bool_,)] * len(xtra_values))
        self.run_unary(pyfunc2, x_types, x_values, func_extra_types=xtra_types, func_extra_args=xtra_values)
    x_values = [1.0, (-1.0), 0.0, (-0.0), 0.5, (-0.5), 5, (-5)]
    x_types = ([types.float32, types.float64] * ((len(x_values) // 2) + 1))
    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), 1j, (-1j), (0.5 + 0j), ((-0.5) + 0j), (0.5 + 0.5j), ((-0.5) - 0.5j), (5 + 5j), ((-5) - 5j)]
    x_types = ([types.complex64, types.complex128] * ((len(x_values) // 2) + 1))
    check(x_types, x_values)
    x_values = np.array(x_values)
    x_types = [types.complex64, types.complex128]
    check(x_types, x_values)
