davidbau / seedrandom

seeded random number generator for Javascript
2.06k stars 160 forks source link

Unbiased float range #30

Closed manuel-di-iorio closed 8 years ago

manuel-di-iorio commented 8 years ago

How can I achieve an unbiased float number between a range of two numbers, with a precision of 8 decimals ?

Let's say I want a number between 0.00010000 and 10,00000000 (ten) I could use: `(Math.floor(prng() * (1000000000 - 10000) + 10000) ) / 100000000;

Are the results of this unbiased ?