Skip to content

Commit 25db225

Browse files
MAINT: random: Explicitly cast RAND_INT_MAX to double to avoid compiler warning
Closes numpygh-28111.
1 parent 1d77082 commit 25db225

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpy/random/src/distributions/distributions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ RAND_INT_TYPE random_zipf(bitgen_t *bitgen_state, double a) {
10231023
* Values below Umin would result in X being rejected because it is too
10241024
* large, so there is no point in including them in the distribution of U.
10251025
*/
1026-
Umin = pow(RAND_INT_MAX, -am1);
1026+
Umin = pow((double) RAND_INT_MAX, -am1);
10271027
while (1) {
10281028
double U01, T, U, V, X;
10291029

0 commit comments

Comments
 (0)