Skip to content

Commit

Permalink
Merge pull request numpy#14458 from ahaldane/fix_hypergeometric_long
Browse files Browse the repository at this point in the history
BUG: random.hypergeometic assumes npy_long is npy_int64, hangs ppc64
  • Loading branch information
eric-wieser authored Sep 9, 2019
2 parents f182f59 + 8904fd7 commit 42ac121
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions numpy/random/mtrand.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3493,9 +3493,9 @@ cdef class RandomState:
cdef int64_t lngood, lnbad, lnsample

# This cast to long is required to ensure that the values are inbounds
ongood = <np.ndarray>np.PyArray_FROM_OTF(ngood, np.NPY_LONG, np.NPY_ALIGNED)
onbad = <np.ndarray>np.PyArray_FROM_OTF(nbad, np.NPY_LONG, np.NPY_ALIGNED)
onsample = <np.ndarray>np.PyArray_FROM_OTF(nsample, np.NPY_LONG, np.NPY_ALIGNED)
ongood = <np.ndarray>np.PyArray_FROM_OTF(ngood, np.NPY_INT64, np.NPY_ALIGNED)
onbad = <np.ndarray>np.PyArray_FROM_OTF(nbad, np.NPY_INT64, np.NPY_ALIGNED)
onsample = <np.ndarray>np.PyArray_FROM_OTF(nsample, np.NPY_INT64, np.NPY_ALIGNED)

if np.PyArray_NDIM(ongood) == np.PyArray_NDIM(onbad) == np.PyArray_NDIM(onsample) == 0:

Expand Down

0 comments on commit 42ac121

Please sign in to comment.