random uses #define oneUp31Bit (4.656612875245796924105750827168e-10) val = (((val* 214013 + 2531011) >> 1) & 0x7fffffff) * oneUp31Bit rand uses one of two algorithms -- selectable Original is #define RNDMUL 15625 rand *= rndmul; rand += 1 New is f(z) = (16807 * z) mod (2 ** 31 - 1) * Based on "Random Number Generators: Good Ones Are Hard to Find", * S.K. Park and K.W. Miller, Communications of the ACM 31:10 (Oct 1988), * and "Two Fast Implementations of the 'Minimal Standard' Random * Number Generator", David G. Carta, Comm. ACM 33, 1 (Jan 1990), p. 87-88 I believe rand with new algorithm is high quality On some machines you can get true random with urandom ==John Quoting mskala@ansuz.sooke.bc.ca: > On Mon, 17 Feb 2014, Paul Batchelor wrote: >> random* lets you specify specific max/min ranges. >> >> rand* does values between 0 and 1 > > The rand* opcodes also seem to allow adjusting the bounds using the > amplitude and offset arguments. But that's what I meant by syntax > differences. Are there any more substantive differences, for instance in > the PRNG algorithms used? > > -- > Matthew Skala > mskala@ansuz.sooke.bc.ca People before principles. > http://ansuz.sooke.bc.ca/ > > > Send bugs reports to the Sourceforge bug trackers > csound6: > https://sourceforge.net/p/csound/tickets/ > csound5: > https://sourceforge.net/p/csound/bugs/ > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body > "unsubscribe csound"