home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
simtel
/
sigm
/
vols000
/
vol064
/
random.lib
< prev
next >
Wrap
Text File
|
1984-04-29
|
313b
|
18 lines
{$F-,R-,S-}
function random( var seed: real ): real;
{ RETURNS RANDOM NUMBERS IN RANGE 0.0 - 1.0 }
{ GLOBAL:
SEED: REAL;
}
CONST PI = 3.14159;
VAR X: REAL;
I: INTEGER;
begin
x := seed + PI;
x := exp(5.0 * ln(x));
seed := x - trunc(x);
random := seed;
end{ of random }; {$F+,R+,S+}