mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Fixing random() to work with longs.
This commit is contained in:
@ -40,7 +40,7 @@ long random(long howbig)
|
|||||||
if (howbig == 0){
|
if (howbig == 0){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return rand() % howbig;
|
return (rand() * 0x10000L + rand()) % howbig;
|
||||||
}
|
}
|
||||||
|
|
||||||
long random(long howsmall, long howbig)
|
long random(long howsmall, long howbig)
|
||||||
|
Reference in New Issue
Block a user