Fixing random() to work with longs.

This commit is contained in:
David A. Mellis 2008-05-26 14:02:32 +00:00
parent 114a19c9a2
commit 3233d7939b
1 changed files with 1 additions and 1 deletions

View File

@ -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)