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
I noticed that in file "index.js" line 14, you add the seed by (MAX_INT32 - 1) which is 2147483646 when seed <= 0, but the implementation on wikipedia and the book around my hand "Data structures and algorithm analysis in c++" all add the seed by 2147483647 when seed < 0.
And I also noticed that in file "index.js" line 25 you use Math.round to get integer from the float value. but if you implemented it in this way, your "integerInRange" will not get a uniform distribution in [min, max], min and max value is roughly half the possibility of other numbers.
The text was updated successfully, but these errors were encountered:
I noticed that in file "index.js" line 14, you add the seed by (MAX_INT32 - 1) which is 2147483646 when seed <= 0, but the implementation on wikipedia and the book around my hand "Data structures and algorithm analysis in c++" all add the seed by 2147483647 when seed < 0.
And I also noticed that in file "index.js" line 25 you use Math.round to get integer from the float value. but if you implemented it in this way, your "integerInRange" will not get a uniform distribution in [min, max], min and max value is roughly half the possibility of other numbers.
The text was updated successfully, but these errors were encountered: