aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/WMath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino/WMath.cpp')
-rw-r--r--cores/arduino/WMath.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/cores/arduino/WMath.cpp b/cores/arduino/WMath.cpp
index 78667f3..294d0dd 100644
--- a/cores/arduino/WMath.cpp
+++ b/cores/arduino/WMath.cpp
@@ -29,23 +29,22 @@ extern "C" {
void randomSeed(unsigned int seed)
{
- if(seed != 0){
- srand(seed);
+ if (seed != 0) {
+ srandom(seed);
}
}
long random(long howbig)
{
- long value;
- if (howbig == 0){
+ if (howbig == 0) {
return 0;
}
- return (rand() * 0x10000L + rand()) % howbig;
+ return random() % howbig;
}
long random(long howsmall, long howbig)
{
- if(howsmall >= howbig){
+ if (howsmall >= howbig) {
return howsmall;
}
long diff = howbig - howsmall;