In which file can I find the calculation that is called with random()
? If it is not too much could you also post the content in your answer? I am using an Arduino Uno and its standard IDE.
I found this in the "WMath.cpp" but that is not the final calculation.
void randomSeed(unsigned int seed)
{
if (seed != 0) {
srandom(seed);
}
}
long random(long howbig)
{
if (howbig == 0) {
return 0;
}
return random() % howbig;
}
long random(long howsmall, long howbig)
{
if (howsmall >= howbig) {
return howsmall;
}
long diff = howbig - howsmall;
return random(diff) + howsmall;
}