Mail Archives: djgpp/1997/02/25/03:22:40
On Mon, 24 Feb 1997, Erik Max Francis wrote:
> random is a non-standard function. Thus you're not guaranteed that it will
> have the same arguments on different compilers.
AFAIK, `random' is POSIX. So at least POSIX-compliant compilers will
have it. Borland, of course, isn't one of them.
> Use rand (which is not as good a pseudorandom number generator in DJGPP),
> like this:
>
> roll = rand()%6 + rand()%6 + rand()%6 + 3;
A known problem with `rand' that using the lower bits of the value
returned by it could get you very bad results. OTOH, `random' is
specifically documented to have all of its bits random.
- Raw text -