I need to generate a number of float
numbers with normal distribution over a range from 0 to a specific ceiling.
I've searched on stack overflow and found similar questions for other languages, but none for .net core.
internal List<float> function(int ceiling, int repetitions)
{
List<float> list = new List<float>();
for (int i = 0; i<= repetitions;i++)
{
list.Add(Random.nextFloat() * ceiling);
}
return list;
}
I expect the function to return a list
of random positive float
numbers, in range from 0 to a given ceiling with at least approximately normal distribution.
Aucun commentaire:
Enregistrer un commentaire