8000 Merge pull request #14490 from WarrenWeckesser/bug-14457 · rgommers/numpy@6584a7d · GitHub
[go: up one dir, main page]

Skip to content

Commit 6584a7d

Browse files
authored
Merge pull request numpy#14490 from WarrenWeckesser/bug-14457
BUG: random: Revert numpygh-14458 and refix numpygh-14557.
2 parents 2f81858 + e389bee commit 6584a7d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

numpy/random/mtrand.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3493,9 +3493,9 @@ cdef class RandomState:
34933493
cdef int64_t lngood, lnbad, lnsample
34943494

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

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

@@ -3517,7 +3517,7 @@ cdef class RandomState:
35173517
# Convert to int64, if necessary, to use int64 infrastructure
35183518
ongood = ongood.astype(np.int64)
35193519
onbad = onbad.astype(np.int64)
3520-
onbad = onbad.astype(np.int64)
3520+
onsample = onsample.astype(np.int64)
35213521
out = discrete_broadcast_iii(&legacy_random_hypergeometric,&self._bitgen, size, self.lock,
35223522
ongood, 'ngood', CONS_NON_NEGATIVE,
35233523
onbad, 'nbad', CONS_NON_NEGATIVE,

0 commit comments

Comments
 (0)
0