Kevin A. Foss wrote:
Yes, it is hard to say what would be "correct" for the system. The C standard however does require a minimum of 32767, so setting it to that should be safe or you could even set it to INT_MAX I suppose (which -should- be defined in limits.h.)
Not in general. Under Solaris, INT_MAX is $7fffffff, but RAND_MAX is only 32767. But when you say 32767 is the required minimum, I can use that if RAND_MAX isn't defined. This gives 15 random bits with one rand() call, so a 64 bit random number requires 5 rand() calls which is at least not *terribly* inefficient...
Frank
-- Frank Heckenbach, frank@fjf.gnu.de http://fjf.gnu.de/ PGP and GPG keys: http://fjf.gnu.de/plan