Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Random-numbers/XPL0/random-numbers.xpl0
Normal file
12
Task/Random-numbers/XPL0/random-numbers.xpl0
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
define PI = 3.14159265358979323846;
|
||||
|
||||
func real DRand; \Uniform distribution, [0..1]
|
||||
return float(Ran(1_000_000)) / 1e6;
|
||||
|
||||
func real RandomNormal; \Normal distribution, centered on 0, std dev 1
|
||||
return sqrt(-2.*Log(DRand)) * Cos(2.*PI*DRand);
|
||||
|
||||
int I;
|
||||
real Rands(1000);
|
||||
for I:= 0 to 1000-1 do
|
||||
Rands(I):= 1.0 + 0.5*RandomNormal
|
||||
Loading…
Add table
Add a link
Reference in a new issue