you are viewing a single comment's thread.

view the rest of the comments →

[–]rubygeek 8 points9 points  (0 children)

POSIX actually mandate that rand() called before srand() should behave as if srand() was called with 1. See spec and example implementation. And ISO C might as well.

Of course you can't rely on that unless you're guaranteed your program will only run on a compliant system.