DEIMOS
rand script

Name

rand -- generate a uniform random value between 0 and 1

Purpose

Returns a uniformly-distributed random number between 0 and 1,
using as a seed either the argument provided or, if none, the
Unix process number

Usage

rand [seed]

Arguments

seed = seed value for random number generator

Example

1) Return a random value:
punaluu{lris}165: rand
0.791128
punaluu{lris}162: ./rand
0.228747
Note that the values differ because the process number (used
by default as the random generator's seed) changed.

2) Return a random value for a given seed:
punaluu{lris}167: ./rand 12345
0.505545
punaluu{lris}168: ./rand 12345
0.505545
Note that the values are the same when the same seed is used.

See Also

The shell script rand
DEIMOS script index


Go to: DEIMOS Home Page - Instruments Home Page - Keck Home Page

Last modified: Wed Jun 9 16:30:32 2004