summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/common/npy_longdouble.c3
-rw-r--r--numpy/core/src/multiarray/arraytypes.c.src5
2 files changed, 3 insertions, 5 deletions
diff --git a/numpy/core/src/common/npy_longdouble.c b/numpy/core/src/common/npy_longdouble.c
index 4e7541f8f..88c8616fd 100644
--- a/numpy/core/src/common/npy_longdouble.c
+++ b/numpy/core/src/common/npy_longdouble.c
@@ -172,8 +172,5 @@ npy_longdouble_from_PyLong(PyObject *long_obj) {
return -1;
}
- // Without this line, MSVC produces garbage (optimizes out result!?)
- printf("Double form is %f\n", (double) result);
-
return result;
}
diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src
index d891f925a..afa44a627 100644
--- a/numpy/core/src/multiarray/arraytypes.c.src
+++ b/numpy/core/src/multiarray/arraytypes.c.src
@@ -30,6 +30,7 @@
#include <emmintrin.h>
#endif
+#include "npy_longdouble.h"
#include "numpyos.h"
#include <string.h>
@@ -331,9 +332,9 @@ string_to_long_double(PyObject*op)
/* Convert python long objects to a longdouble, without precision or range
* loss via a double.
*/
- if (PyLong_Check(op)
+ if ((PyLong_Check(op) && !PyBool_Check(op))
#if !defined(NPY_PY3K)
- || PyInt_Check(op)
+ || (PyInt_Check(op) && !PyBool_Check(op))
#endif
) {
return npy_longdouble_from_PyLong(op);