summaryrefslogtreecommitdiff
path: root/numpy/doc/indexing.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-02-15 17:58:25 -0700
committerCharles Harris <charlesr.harris@gmail.com>2016-02-18 21:31:05 -0700
commit735174b88768999a2247f960669185978587408a (patch)
tree11406be9616ac7976d386a81c4b4ec8f5eaab39d /numpy/doc/indexing.py
parentfbeae17e5db78d5c7607bc21f16f6dcdb635c18e (diff)
downloadnumpy-735174b88768999a2247f960669185978587408a.tar.gz
ENH: Make numpy ufuncs compatible with Python divmod.
The following numpy ufuncs are reimplemented using the npy_divmod function. - remainder ('%') - floor_divide ('//') Example of differences Currently In [1]: a = np.array(78 * 6e-8) In [2]: b = np.array(6e-8) In [3]: a // b Out[3]: 77.0 In [4]: a % b Out[4]: 5.9999999999999651e-08 Previously In [1]: a = np.array(78 * 6e-8) In [2]: b = np.array(6e-8) In [3]: a // b Out[3]: 78.0 In [4]: a % b Out[4]: 0.0 The first agrees with the Python values for the same operation and is a bit more accurate for the input values as represented internally. Closes #7224.
Diffstat (limited to 'numpy/doc/indexing.py')
0 files changed, 0 insertions, 0 deletions