| 1171 | } |
| 1172 | |
| 1173 | static inline npy_bool buffered_bounded_bool(bitgen_t *bitgen_state, |
| 1174 | npy_bool off, npy_bool rng, |
| 1175 | npy_bool mask, int *bcnt, |
| 1176 | uint32_t *buf) { |
| 1177 | if (rng == 0) |
| 1178 | return off; |
| 1179 | if (!(bcnt[0])) { |
| 1180 | buf[0] = next_uint32(bitgen_state); |
| 1181 | bcnt[0] = 31; |
| 1182 | } else { |
| 1183 | buf[0] >>= 1; |
| 1184 | bcnt[0] -= 1; |
| 1185 | } |
| 1186 | return (buf[0] & 0x00000001UL) != 0; |
| 1187 | } |
| 1188 | |
| 1189 | /* Static `Lemire rejection` function called by random_bounded_uint64(...) */ |
| 1190 | static inline uint64_t bounded_lemire_uint64(bitgen_t *bitgen_state, |
no test coverage detected