Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Random-numbers/Pascal/random-numbers.pas
Normal file
10
Task/Random-numbers/Pascal/random-numbers.pas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
function rnorm (mean, sd: real): real;
|
||||
{Calculates Gaussian random numbers according to the Box-Müller approach}
|
||||
var
|
||||
u1, u2: real;
|
||||
begin
|
||||
u1 := random;
|
||||
u2 := random;
|
||||
rnorm := mean * abs(1 + sqrt(-2 * (ln(u1))) * cos(2 * pi * u2) * sd);
|
||||
/* error !?! Shouldn't it be "mean +" instead of "mean *" ? */
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue