def testRemainder(self):
     print 'Remainder testing'
     a = np.remainder([4,7], [2,3])
     self.checkitems([0, 1], a)
     self.checkitems([0, -2,  5, -1], np.remainder([4, 7, -3, -7], [2, -3,  8, -3]))
     self.checkitems([0, 1,  -3, -1], np.fmod([4, 7, -3, -7], [2, -3,  8, -3]))
     self.checkitems([-1,  0, -1,  1,  0,  1], np.fmod([-3, -2, -1, 1, 2, 3], 2))
     self.checkitems([1, 0, 1, 1, 0, 1], np.mod([-3, -2, -1, 1, 2, 3], 2))
Beispiel #2
0
 def testRemainder(self):
     print 'Remainder testing'
     a = np.remainder([4,7], [2,3])
     self.checkitems([0, 1], a)
     self.checkitems([0, -2,  5, -1], np.remainder([4, 7, -3, -7], [2, -3,  8, -3]))
     self.checkitems([0, 1,  -3, -1], np.fmod([4, 7, -3, -7], [2, -3,  8, -3]))
     self.checkitems([-1,  0, -1,  1,  0,  1], np.fmod([-3, -2, -1, 1, 2, 3], 2))
     self.checkitems([1, 0, 1, 1, 0, 1], np.mod([-3, -2, -1, 1, 2, 3], 2))