Commits

Neil Blakey-Milner committed 5b3e480

Export numpy.floor_divide and a basic test

  • Participants
  • Parent commits 2242a6b

Comments (0)

Files changed (2)

pypy/module/micronumpy/__init__.py

         ('log10', 'log10'),
         ('log1p', 'log1p'),
         ('power', 'power'),
+        ('floor_divide', 'floor_divide'),
     ]:
         interpleveldefs[exposed] = "interp_ufuncs.get(space).%s" % impl
 

pypy/module/micronumpy/test/test_ufuncs.py

         c = power(a, b)
         for i in range(len(a)):
             assert c[i] == a[i] ** b[i]
+
+    def test_floordiv(self):
+        from _numpypy import floor_divide, array
+        a = array([1., 2., 3., 4., 5., 6., 6.01])
+        b = floor_divide(a, 2.5)
+        for i in range(len(a)):
+            assert b[i] == a[i] // 2.5