diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-02-15 17:58:25 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2016-02-18 21:31:05 -0700 |
commit | 735174b88768999a2247f960669185978587408a (patch) | |
tree | 11406be9616ac7976d386a81c4b4ec8f5eaab39d /numpy/lib/tests/test_function_base.py | |
parent | fbeae17e5db78d5c7607bc21f16f6dcdb635c18e (diff) | |
download | numpy-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/lib/tests/test_function_base.py')
0 files changed, 0 insertions, 0 deletions