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
So, maybe, there needs to be a fallback like Math.Pow(0.9999, 10_000_000/(double)n); for larger numbers.
Maybe, a fallback should already be there for ints, because for ~0,000001% of the weights (higher if we would allow long weights), it does not even make a difference, whether they are int.MaxValue or int.MaxValue / 10 (edge case):
SortingBasedWeightedLeftShuffle
can't handle a combination of large priorities and large random doubles:So, maybe, there needs to be a fallback like
Math.Pow(0.9999, 10_000_000/(double)n);
for larger numbers.Maybe, a fallback should already be there for ints, because for ~0,000001% of the weights (higher if we would allow long weights), it does not even make a difference, whether they are
int.MaxValue
orint.MaxValue / 10
(edge case):This gets worse when allowing to specify priorities as longs (see #14)
Furthermore: Random.NextDouble being exactly 0 could also be problematic as the result is always 0...
(from #14)
The text was updated successfully, but these errors were encountered: