Date: Mon, 26 Sep 1994 09:55:29 +0100 (MET) From: ZRS Subject: Thanks for rand() problems. To: djgpp OK, never, never use ANSI rand()! :-))) Thanks to Gordon Hogenson for warning me about poorness of the ANSI implementation of rand(). (BTW: I'm used to such IBM's statements!!! ;-)) Thanks for the code!! Thanks to Bob Babcock for the "shifting-down" hint. It IS in the C language FAQ (I suppose...) And finally, thanks to Ed Phillips, but... ?rand48() is not implemented in every standard C library (AFAIK), and I'd prefer a more portable impl.! OK, but what about the strange ODD/EVEN return of djgpp 1.12 (GCC 2.6.0) rand() function? And why under Linux op.sys. (GCC 2.5.8) it WORKS ???? Last question: what about portable, VERY good random number generator function?? I know something about R250 and Marsaglia Random; any other out there? BTW, I just want to throw some dice and tell the user: oh, you hit 7!!! :-) ReThanks and BYE! ZRS (roalz AT varano DOT ing DOT unico DOT it)