www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/09/26/06:16:43

Date: Mon, 26 Sep 1994 09:55:29 +0100 (MET)
From: ZRS <roalz AT varano DOT ing DOT unico DOT it>
Subject: Thanks for rand() problems.
To: djgpp <djgpp AT sun DOT soe DOT clarkson DOT edu>

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)



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019