summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-08-04 19:01:43 -0500
committerGitHub <noreply@github.com>2016-08-04 19:01:43 -0500
commitbfd91d9e91ec5ea1c1d77b27b09952a11a24e19e (patch)
treee0fd8a0f751d605547eaaf008f6acb1578a983f9 /numpy/core
parent4c415d2dbacb9117e295ad634bbe1d88de5b3ed6 (diff)
parent07800e53ea335bc64514e9b4b0a5e5711fd39684 (diff)
downloadnumpy-bfd91d9e91ec5ea1c1d77b27b09952a11a24e19e.tar.gz
Merge pull request #7903 from juliantaylor/sqrt-type-fix
BUG: fix float16 type not being called due to wrong ordering
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/code_generators/generate_umath.py1
-rw-r--r--numpy/core/src/umath/scalarmath.c.src5
2 files changed, 4 insertions, 2 deletions
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py
index e79cdd4a6..d44cabe72 100644
--- a/numpy/core/code_generators/generate_umath.py
+++ b/numpy/core/code_generators/generate_umath.py
@@ -696,6 +696,7 @@ defdict = {
Ufunc(1, 1, None,
docstrings.get('numpy.core.umath.sqrt'),
None,
+ TD('e', f='sqrt', astype={'e':'f'}),
TD(inexactvec),
TD(inexact, f='sqrt', astype={'e':'f'}),
TD(P, f='sqrt'),
diff --git a/numpy/core/src/umath/scalarmath.c.src b/numpy/core/src/umath/scalarmath.c.src
index c651383eb..32a77b6e9 100644
--- a/numpy/core/src/umath/scalarmath.c.src
+++ b/numpy/core/src/umath/scalarmath.c.src
@@ -1703,9 +1703,10 @@ get_functions(PyObject * mm)
* generate_umath.py, the first to go into FLOAT/DOUBLE_sqrt
* they have the same signature as the scalar variants so we need to skip
* over them
+ * also skip float16 copy placed before
*/
- i = 4;
- j = 2;
+ i = 6;
+ j = 3;
while (signatures[i] != NPY_FLOAT) {
i += 2; j++;
}