Basic Random Number Generation (CEERAN0) API


  Required Parameter Group:

1 seed I/O INT4
2 random_no Output FLOAT8

  Omissible Parameter:

3 fc Output FEEDBACK

  Service Program Name: QLEMF

  Default Public Authority: *USE

  Threadsafe: Yes

The Basic Random Number Generation (CEERAN0) API generates a sequence of uniform pseudorandom numbers between 0 and 1 using the multiplicative congruential method with a user-specified seed.


Authorities and Locks

None.


Required Parameter Group

seed (I/O)
A 32-bit binary integer representing an initial value used to generate random numbers. It must be a variable; that is, it cannot be an input-only parameter. The valid range is 0 to 2 147 483 646.

If the value of the seed parameter is 0, the seed is generated from the current Greenwich Mean Time.

On return, CEERAN0 changes the value of seed so that it may be used as the new seed in the next call.

random_no (output)
A 64-bit double floating-point pseudorandom number with a value between 0 and 1, exclusive. If seed is not valid, random_no is set to -1 and CEERAN0 ends with a nonzero feedback code.

Omissible Parameter

fc (output)
A 12-byte feedback code passed by reference. If specified as an argument, feedback information (a condition token) is returned to the calling procedure. If not specified, and the requested operation was not successfully completed, the condition is signaled to the condition manager.

Feedback Codes and Conditions

CEE0000 The API completed successfully
Severity: 00  
CEE2523 UTC not available to generate random seed from system time
Severity: 10  
CEE2524 Seed value for &1 is not valid
Severity: 30  


API introduced: V2R3
Top | ILE CEE APIs | APIs by category