You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By taking a look at testlib.h, unsigned long long next(unsigned long long n) is using long long next(long long n), so basically you can't reach 2^64-1.
To create your rnd.next for unsigned 64bits you can just modify nextBits to operate with unsigned long long all the way instead of long long (seed, multiplier, addend and mask are all unsigned long long so it's not a problem) and accept 64bits... I don't know why they add this limitation
to = 2^64-1, from = 0, therefore to - from + 1 = 2^64 = 0 for unsigned long long.
Is there any solutions to random in [0, 2^64-1] in one shot?
The text was updated successfully, but these errors were encountered: