8000 ENH: Make numpy floor_divide and remainder agree with Python `//` and `%`. by charris · Pull Request #7258 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Make numpy floor_divide and remainder agree with Python // and %. #7258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 21, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Fai 8000 led to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
MAINT: Remove floor function code no longer needed in scalarmath.
The floor function is no longer needed in scalarmath as its use has been
replaced by the new pymodf function.
  • Loading branch information
charris committed Feb 19, 2016
commit fbeae17e5db78d5c7607bc21f16f6dcdb635c18e
21 changes: 0 additions & 21 deletions numpy/core/src/umath/scalarmath.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ static void
* #type = npy_float, npy_double, npy_longdouble#
* #c = f, , l#
*/
static @type@ (*_basic_@name@_floor)(@type@);
static @type@ (*_basic_@name@_sqrt)(@type@);
static @type@ (*_basic_@name@_fmod)(@type@, @type@);

Expand Down Expand Up @@ -304,7 +303,6 @@ static void

/**end repeat**/

static npy_half (*_basic_half_floor)(npy_half);
static npy_half (*_basic_half_sqrt)(npy_half);
static npy_half (*_basic_half_fmod)(npy_half, npy_half);

Expand Down Expand Up @@ -1691,25 +1689,6 @@ get_functions(PyObject * mm)
_basic_clongdouble_pow = funcdata[j + 5];
Py_DECREF(obj);

/* Get the floor functions */
obj = PyObject_GetAttrString(mm, "floor");
if (obj == NULL) {
goto fail;
}
funcdata = ((PyUFuncObject *)obj)->data;
signatures = ((PyUFuncObject *)obj)->types;
i = 0;
j = 0;
while(signatures[i] != NPY_FLOAT) {
i += 2;
j++;
}
_basic_half_floor = funcdata[j - 1];
_basic_float_floor = funcdata[j];
_basic_double_floor = funcdata[j + 1];
_basic_longdouble_floor = funcdata[j + 2];
Py_DECREF(obj);

/* Get the sqrt functions */
obj = PyObject_GetAttrString(mm, "sqrt");
if (obj == NULL) {
Expand Down
0