Open
Description
When I try to run this line of code:
rnd.next(INT64_MIN + INT32_MAX - 1LL, INT64_MAX - INT32_MAX + 1LL)
I get the next error:
random_t::next(long long n): n must be positive
.
It is caused by the implementation of next(long long, long long)
: it calls next(to - from + 1)
, but to - from + 1
is negative because of long long
overflow.
Metadata
Metadata
Assignees
Labels
No labels