Re: random number problem

From: Paul Hsieh (qed_at_pobox.com)
Date: 07/12/04


Date: 12 Jul 2004 03:27:12 -0700

Jens.Toerring@physik.fu-berlin.de wrote:
> [...] And even if he uses the standard C function rand() he's mapping from
> the interval [0,RAND_MAX] to a usually much smaller interval, with RAND_MAX
> typically being in the order of 2^31 on modern machines.

Both WATCOM C/C++ and Microsoft Visual C++ (and therefore Intel C/C++)
set RAND_MAX to 32767. (Though gcc sets it to 2147483647).

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/