Skip to content

Commit

Permalink
Merge 331774f into 366dfc9
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtage committed Oct 24, 2019
2 parents 366dfc9 + 331774f commit 57675e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions randomgen/src/distributions/distributions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ static NPY_INLINE uint32_t buffered_bounded_lemire_uint32(

if (leftover < rng_excl) {
/* `rng_excl` is a simple upper bound for `threshold`. */
const uint32_t threshold = -rng_excl % rng_excl;
const uint32_t threshold = ((uint32_t)(-rng_excl)) % rng_excl;
/* Same as: threshold=((uint64_t)(0x100000000ULL - rng_excl)) % rng_excl; */

while (leftover < threshold) {
Expand Down Expand Up @@ -1405,7 +1405,7 @@ static NPY_INLINE uint16_t buffered_bounded_lemire_uint16(

if (leftover < rng_excl) {
/* `rng_excl` is a simple upper bound for `threshold`. */
const uint16_t threshold = -rng_excl % rng_excl;
const uint16_t threshold = ((uint16_t)(-rng_excl)) % rng_excl;
/* Same as: threshold=((uint32_t)(0x10000ULL - rng_excl)) % rng_excl; */

while (leftover < threshold) {
Expand Down Expand Up @@ -1441,7 +1441,7 @@ static NPY_INLINE uint8_t buffered_bounded_lemire_uint8(bitgen_t *bitgen_state,

if (leftover < rng_excl) {
/* `rng_excl` is a simple upper bound for `threshold`. */
const uint8_t threshold = -rng_excl % rng_excl;
const uint8_t threshold = ((uint8_t)(-rng_excl)) % rng_excl;
/* Same as: threshold=((uint16_t)(0x100ULL - rng_excl)) % rng_excl; */

while (leftover < threshold) {
Expand Down
4 changes: 2 additions & 2 deletions randomgen/tests/test_final_release_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
Xoroshiro128, Xorshift1024, Xoshiro256, Xoshiro512]


@pytest.fixture('module', params=bit_generators)
@pytest.fixture(scope='module', params=bit_generators)
def bit_generator(request):
return request.param


@pytest.fixture('module', params=[True, False])
@pytest.fixture(scope='module', params=[True, False])
def endpoint(request):
return request.param

Expand Down

0 comments on commit 57675e0

Please sign in to comment.