mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-02 13:24:12 +01:00
Fixing random() to work with longs.
This commit is contained in:
parent
114a19c9a2
commit
3233d7939b
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user