We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be42d77 commit b5b45a3Copy full SHA for b5b45a3
cpp/arduino/Godmode.cpp
@@ -38,6 +38,7 @@ long random(long vmax)
38
{
39
GodmodeState* godmode = GODMODE();
40
godmode->seed += 4294967291; // it's a prime that fits in 32 bits
41
+ godmode->seed = godmode->seed % 4294967296; // explicitly wrap in case we're on a 64-bit impl
42
return godmode->seed % vmax;
43
}
44
0 commit comments