XLPack 6.1
C/C++ API Reference Manual
Loading...
Searching...
No Matches

◆ _seed48()

unsigned short * _seed48 ( unsigned short  xseed[])

Initialization with 48-bit seed for drand48, lrand48 and mrand48 (Linear congruential method)

Purpose
This routine initializes drand48, lrand48 and mrand48.
Returns
Pointer to the previous seed (16-bit x 3). (the contents will be updated when this routine is called)
Parameters
[in]xseed[]Array xseed[3]
48-bit (16-bit x 3) seed.
Function call with the following arguments is equivalent to calling srand48(seed).
  xseed[0] = 0x330e;
  xseed[1] = seed % pow(2, 16);
  xseed[2] = seed / pow(2, 16);
Note
  • If the random number generator is called without an initialization by seed48() or srand48(), it will be automatically initialized by using xseed[0] = 0x330e, xseed[1] = 0xabcd, and xseed[2] = 0x1234 as the seed.
  • The multiplicand a and the addend c, set up by lcong48(), will be reset to the default values.
  • This routine is provided for Windows version.