jeudi 5 avril 2018

What are the odds of a random number generated in given range being higher than given number?

For example, given the range between 90 and 100:

float a = 100;
float b = 93;
float c = 106;
a *= random.nextFloat() * 0.2f + 0.9f;
//what's the chance of a > b
//what's the chance of a > c




Aucun commentaire:

Enregistrer un commentaire