def test_fmod_float(self): a = blaze.array([-3, -2, -1, 0, 1, 2, 3], dshape='float32') a_fmod_2 = blaze.array([-1, 0, -1, 0, 1, 0, 1], dshape='float32') a_fmod_3 = blaze.array([0, -2, -1, 0, 1, 2, 0], dshape='float32') assert_equal(blaze.fmod(a, 2), a_fmod_2) assert_equal(blaze.fmod(a, 3), a_fmod_3)
def test_fmod_int(self): a = blaze.array([-3, -2, -1, 0, 1, 2, 3]) a_fmod_2 = blaze.array([-1, 0, -1, 0, 1, 0, 1]) a_fmod_3 = blaze.array([0, -2, -1, 0, 1, 2, 0]) assert_equal(blaze.fmod(a, 2), a_fmod_2) assert_equal(blaze.fmod(a, 3), a_fmod_3)