MCPcopy Create free account
hub / github.com/numpy/numpy / buffered_bounded_masked_uint8

Function buffered_bounded_masked_uint8

numpy/random/src/distributions/distributions.c:1160–1171  ·  view source on GitHub ↗

Static `masked rejection` function called by * random_buffered_bounded_uint8(...) */

Source from the content-addressed store, hash-verified

1158/* Static `masked rejection` function called by
1159 * random_buffered_bounded_uint8(...) */
1160static inline uint8_t buffered_bounded_masked_uint8(bitgen_t *bitgen_state,
1161 uint8_t rng,
1162 uint8_t mask,
1163 int *bcnt,
1164 uint32_t *buf) {
1165 uint8_t val;
1166
1167 while ((val = (buffered_uint8(bitgen_state, bcnt, buf) & mask)) > rng)
1168 ;
1169
1170 return val;
1171}
1172
1173static inline npy_bool buffered_bounded_bool(bitgen_t *bitgen_state,
1174 npy_bool off, npy_bool rng,

Callers 2

Calls 1

buffered_uint8Function · 0.85

Tested by

no test coverage detected