def test_mod():
 (x, y) = fscalars('xy')
 fn = gof.DualLinker().accept(gof.FunctionGraph([x, y], [(x % y)])).make_function()
 for (a, b) in ((0, 1), (1, 1), (0, (-1)), (1, (-1)), ((-1), (-1)), (1, 2), ((-1), 2), (1, (-2)), ((-1), (-2)), (5, 3), ((-5), 3), (5, (-3)), ((-5), (-3))):
  assert (fn(a, b) == (a % b)), (a,)

def test_mod ( ) : ( x , y ) = fscalars ( 'xy' ) fn = gof . DualLinker ( ) . accept ( gof . FunctionGraph ( [ x , y ] , [ ( x % y ) ] ) ) . make_function ( ) for ( a , b ) in ( ( 0 , 1 ) , ( 1 , 1 ) , ( 0 , ( - 1 ) ) , ( 1 , ( - 1 ) ) , ( ( - 1 ) , ( - 1 ) ) , ( 1 , 2 ) , ( ( - 1 ) , 2 ) , ( 1 , ( - 2 ) ) , ( ( - 1 ) , ( - 2 ) ) , ( 5 , 3 ) , ( ( - 5 ) , 3 ) , ( 5 , ( - 3 ) ) , ( ( - 5 ) , ( - 3 ) ) ) : assert ( fn ( a , b ) == ( a % b ) ) , ( a , )
we add this test as not all language and c implementation give the same sign to the result .