-
Notifications
You must be signed in to change notification settings - Fork 579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BigInt::random_integer hangs #3590
Comments
This is const size_t bits = max.bits();
do {
r.randomize(rng, bits, false);
} while(r < min || r >= max); I guess it will finish eventually, but it might be better to do generate an int in the range |
Confirmed, thanks. We'll have to be careful about changing the logic as a number of tests rely on the current behavior, but obviously taking forever on certain inputs is no good. I'll take a look. |
randombit
added a commit
that referenced
this issue
Jun 23, 2023
We maintain a distinct codepath for the case where min is 0 or 1, since otherwise certain tests which expect stability of this function will break. If min is > 1, we generate a number in the range `min + [0,max-min)`, which avoids the slow case. Fixes #3590
@guidovranken Fixed now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: