We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
shy and wayfinder reported/tested this on Discord.
It looks like weightedPick() undersamples the first and last array members.
https://codepen.io/samme/pen/qBQKYxN?editors=0110
I think it's supposed to be
return array[~~(Math.pow(this.frac(), 2) * array.length)];
The text was updated successfully, but these errors were encountered:
Thanks. I think the distribution looks better with return array[~~(Math.pow(this.frac(), 2) * array.length + 0.5)];:
return array[~~(Math.pow(this.frac(), 2) * array.length + 0.5)];
As without the 0.5, the first element is massively favoured:
But it definitely looks wrong with the array.length - 1.
array.length - 1
Sorry, something went wrong.
f844e96
No branches or pull requests
Version
Description
shy and wayfinder reported/tested this on Discord.
It looks like weightedPick() undersamples the first and last array members.
Example Test Code
https://codepen.io/samme/pen/qBQKYxN?editors=0110
Additional Information
I think it's supposed to be
The text was updated successfully, but these errors were encountered: