Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
9
Task/Random-numbers/Pascal/random-numbers.pascal
Normal file
9
Task/Random-numbers/Pascal/random-numbers.pascal
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
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);
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue