Closed
Description
As coded below in Math.cpp, the random number is biased
long random(long howbig)
{
if(howbig == 0) {
return 0;
}
return esp_random() % howbig;
}
esp_random provides a 32 bit random integer so a number between 0 and 4294967295.
Returning a modulo number is biased. For example if howbig is 100, then all numbers between 0 and 95 have the same probability but numbers between 96 and 99 have a lower probability.
Metadata
Metadata
Assignees
Labels
No labels