Re: corrections for GPC 19980830 (SunOS|BSD)
2 Nov
1998
2 Nov
'98
2:36 a.m.
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
10147
Age (days ago)
10147
Last active (days ago)
0 comments
1 participants
participants (1)
-
Frank Heckenbach