mardi 22 octobre 2019

random number generation in C++ within a range

I have a question where I have to generate random numbers with following condition
1) number should be b/w 0 and 1.

2) numbers are produced in equally likely manner

let's say I have a number x eg 0.0028. If I call this random number generator 10000 times then it should produce numbers less than x to be 28. How can this be achieved. Does someone have any idea. I tried to use various distributions but was not successful in achieving the desired result.




Aucun commentaire:

Enregistrer un commentaire