#NEWLINE# def test_sinc( self ) : #NEWLINE# #INDENT# '\n        Tests the sinc() function.\n        This test is purely to assert numerical computations are correct.\n        ' #NEWLINE# isoz = True #NEWLINE# tol = 'eps' #NEWLINE# pyfunc = sinc #NEWLINE# def check( x_types , x_values , **kwargs ) : #NEWLINE# #INDENT# self . run_unary ( pyfunc , x_types , x_values , ignore_sign_on_zero = isoz , abs_tol = tol , ** kwargs ) #NEWLINE# #UNINDENT# x_values = [ 1.0 , ( - 1.0 ) , 0.0 , ( - 0.0 ) , 0.5 , ( - 0.5 ) , 5 , ( - 5 ) , 5e-21 , ( - 5e-21 ) ] #NEWLINE# x_types = ( [ types . float32 , types . float64 ] * ( len ( x_values ) // 2 ) ) #NEWLINE# check ( x_types , x_values ) #NEWLINE# x_values = [ np . array ( x_values , dtype = np . float64 ) ] #NEWLINE# x_types = [ typeof ( v ) for v in x_values ] #NEWLINE# check ( x_types , x_values ) #NEWLINE# 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 ) ) ] #NEWLINE# x_types = ( [ types . complex64 , types . complex128 ] * ( len ( x_values ) // 2 ) ) #NEWLINE# check ( x_types , x_values , ulps = 2 ) #NEWLINE# x_values = [ np . array ( x_values , dtype = np . complex128 ) ] #NEWLINE# x_types = [ typeof ( v ) for v in x_values ] #NEWLINE# check ( x_types , x_values , ulps = 2 )