Skip to content

Commit dbdfb0e

Browse files
committed
RandomDataGenerator.shuffle has been fixed to use the proper modifier in the calculation, allowing for a more even distribution
1 parent db0be54 commit dbdfb0e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/math/random-data-generator/RandomDataGenerator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ var RandomDataGenerator = new Class({
478478

479479
for (var i = len; i > 0; i--)
480480
{
481-
var randomIndex = Math.floor(this.frac() * (len + 1));
481+
var randomIndex = Math.floor(this.frac() * (i + 1));
482482
var itemAtIndex = array[randomIndex];
483483

484484
array[randomIndex] = array[i];

0 commit comments

Comments
 (0)