Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Monte-Carlo-methods/11l/monte-carlo-methods.11l
Normal file
10
Task/Monte-Carlo-methods/11l/monte-carlo-methods.11l
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
F monte_carlo_pi(n)
|
||||
V inside = 0
|
||||
L 1..n
|
||||
V x = random:()
|
||||
V y = random:()
|
||||
I x * x + y * y <= 1
|
||||
inside++
|
||||
R 4.0 * inside / n
|
||||
|
||||
print(monte_carlo_pi(1000000))
|
||||
Loading…
Add table
Add a link
Reference in a new issue