コード例 #1
0
 def test_remainder_mod_float(self):
     a = blaze.array([-3, -2, -1, 0, 1, 2, 3], dshape='float32')
     a_mod_2 = blaze.array([1,  0, 1,  0, 1,  0,  1], dshape='float32')
     a_mod_3 = blaze.array([0,  1, 2,  0, 1,  2,  0], dshape='float32')
     assert_equal(blaze.remainder(a, 2), a_mod_2)
     assert_equal(blaze.mod(a, 2), a_mod_2)
     assert_equal(blaze.remainder(a, 3), a_mod_3)
     assert_equal(blaze.mod(a, 3), a_mod_3)
コード例 #2
0
 def test_remainder_mod_int(self):
     a = blaze.array([-3, -2, -1, 0, 1, 2, 3])
     a_mod_2 = blaze.array([1,  0, 1,  0, 1,  0,  1])
     a_mod_3 = blaze.array([0,  1, 2,  0, 1,  2,  0])
     assert_equal(blaze.remainder(a, 2), a_mod_2)
     assert_equal(blaze.mod(a, 2), a_mod_2)
     assert_equal(blaze.remainder(a, 3), a_mod_3)
     assert_equal(blaze.mod(a, 3), a_mod_3)