diff options
author | Han Shen <shenhan@google.com> | 2017-11-30 10:15:55 -0800 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-12-11 20:23:21 -0800 |
commit | f9aecaf5b1fc918cf6e898d1240336f7e2e8c743 (patch) | |
tree | 292c27853ed0de4d2ced2cb5c63805cc6d277827 /numpy/doc/byteswapping.py | |
parent | 8032cf4762008155fca610fb61092e6c9ecae98b (diff) | |
download | numpy-f9aecaf5b1fc918cf6e898d1240336f7e2e8c743.tar.gz |
BUG: Fix corner cases when value is NaN.
The case is illustrated below:
In "_safe_ceil_to_intp":
ivalue = npy_ceil(value); <= ivalue is NaN when value is NaN.
if (ivalue < NPY_MIN_INTP || ivalue > NPY_MAX_INTP) {
return -1; <= this is never executed when ivalue is NaN.
}
*ret = (npy_intp)ivalue; <= this is undefined behavior when ivalue is NaN.
Diffstat (limited to 'numpy/doc/byteswapping.py')
0 files changed, 0 insertions, 0 deletions