
June 24th, 1999, 05:40 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
I am using the rand() function in php3. Without arguments it seems to behave as advertised, returning an integer between 0 and getrandmax(). It seems to behave the same way with arguments, though, e.g. rand(1,15) -> 1774965089, rather than a number between 1 and 15.
This is not because I haven't seeded the generator --- I use srand as in the manual before I start making calls to rand.
Also, this would OK if there were a modulus function (e.g. rand() mod 15), but I don't see one in the math section of the manual.
Any help appreciated.
Timboy
|