9.176 RANDOM_NUM_GENERATOR

Note: Built-In Function Rules     Usage Options

Returns a random number between 0 and 1.

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

N

Opt

Stream index

1

2

0

0

2

N

Opt

Seed

1

10

0

0

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

N

Req

Random number between 0 and 1.

1

63

1

63

 

Technical Notes

Examples

Get the next random number from the default stream (0):

Use Builtin(RANDOM_NUM_GENERATOR) To_Get(#x_dec)

Get the next random number from stream 23:

Use Builtin(RANDOM_NUM_GENERATOR) With_Args(23) To_Get(#x_dec)

Seed stream 42 with the value 12345. n.b. This seeds the stream and so will always return the same random number value:

Use Builtin(RANDOM_NUM_GENERATOR) With_Args(42 12345) To_Get(#x_dec)

Seed the default stream (0) with the value 56789.
Note: This seeds the stream and so will always return the same value:

Use Builtin(RANDOM_NUM_GENERATOR) With_Args(*DEFAULT 56789) To_Get(#x_dec)