summaryrefslogtreecommitdiff
path: root/numpy/testing/nose_tools/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/testing/nose_tools/utils.py')
-rw-r--r--numpy/testing/nose_tools/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/testing/nose_tools/utils.py b/numpy/testing/nose_tools/utils.py
index 2d97b5c1e..ff3cf841c 100644
--- a/numpy/testing/nose_tools/utils.py
+++ b/numpy/testing/nose_tools/utils.py
@@ -1577,7 +1577,9 @@ def integer_repr(x):
"""Return the signed-magnitude interpretation of the binary representation of
x."""
import numpy as np
- if x.dtype == np.float32:
+ if x.dtype == np.float16:
+ return _integer_repr(x, np.int16, np.int16(-2**15))
+ elif x.dtype == np.float32:
return _integer_repr(x, np.int32, np.int32(-2**31))
elif x.dtype == np.float64:
return _integer_repr(x, np.int64, np.int64(-2**63))