Mail Archives: djgpp/1996/05/06/23:10:36
bennett AT erich DOT triumf DOT ca (P.Bennett) writes:
>Perhaps you have previously used a Borland or Microsoft compiler, where ints
>are 16 bits, and RAND_MAX is 32767. I expect that DJGPP has 32 bit ints, so
>RAND_MAX will be 2,147,483,647. (or so)
This connection is common, but not necessary. RAND_MAX cannot be greater
than INT_MAX for obvious reasons, but there is no need for RAND_MAX being
close to INT_MAX.
>If you want to restrict the numbers to 16 bits, you will have to use short
>ints, rather than plain ints.
And, afaik, there is no guarantee that short int is a 16 bit integer
type, it is just a common implementation.
Kurt
--
| Kurt Watzka Phone : +49-89-2180-6254
| watzka AT stat DOT uni-muenchen DOT de
- Raw text -