Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
13
Task/Random-numbers/ReScript/random-numbers.res
Normal file
13
Task/Random-numbers/ReScript/random-numbers.res
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
let pi = 4.0 *. atan(1.0)
|
||||
|
||||
let random_gaussian = () => {
|
||||
1.0 +.
|
||||
sqrt(-2.0 *. log(Random.float(1.0))) *.
|
||||
cos(2.0 *. pi *. Random.float(1.0))
|
||||
}
|
||||
|
||||
let a = Belt.Array.makeBy(1000, (_) => random_gaussian ())
|
||||
|
||||
for i in 0 to 10 {
|
||||
Js.log(a[i])
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue