… | |
… | |
489 | return !is_constant (num) ? get_range (num) // non-constant |
489 | return !is_constant (num) ? get_range (num) // non-constant |
490 | : num & (num - 1) ? (this->next () * (uint64_t)num) >> 32U // constant, non-power-of-two |
490 | : num & (num - 1) ? (this->next () * (uint64_t)num) >> 32U // constant, non-power-of-two |
491 | : this->next () & (num - 1); // constant, power-of-two |
491 | : this->next () & (num - 1); // constant, power-of-two |
492 | } |
492 | } |
493 | |
493 | |
494 | // return a number within the closed interval [min .. max] |
494 | // return a number within the closed interval [min .. max], max can be >, < or == min. |
495 | int operator () (int r_min, int r_max) |
495 | int operator () (int r_min, int r_max) |
496 | { |
496 | { |
497 | return is_constant (r_min <= r_max) && r_min <= r_max |
497 | return is_constant (r_min <= r_max) && r_min <= r_max |
498 | ? r_min + operator ()(r_max - r_min + 1) |
498 | ? r_min + operator ()(r_max - r_min + 1) |
499 | : get_range (r_min, r_max); |
499 | : get_range (r_min, r_max); |