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
The casual.integer generator is noticeably biased away from the ends of the range; the start and end of the range only occur with half the frequency of the other elements.
The reason for this is the use of Math.round and a range of to-from, which is not big enough. A better formula might be:
Math.floor(from (to - from 1) * this.random)
Of course, this would break anyone who is depending on the same answers with the same seed, so maybe a new method would be better?
The text was updated successfully, but these errors were encountered:
The
casual.integer
generator is noticeably biased away from the ends of the range; the start and end of the range only occur with half the frequency of the other elements.The reason for this is the use of
Math.round
and a range ofto-from
, which is not big enough. A better formula might be:Math.floor(from (to - from 1) * this.random)
Of course, this would break anyone who is depending on the same answers with the same seed, so maybe a new method would be better?
The text was updated successfully, but these errors were encountered: