Translations:Estimando PI utilizando Monte Carlo/17/en
Ir para navegação
Ir para pesquisar
- was the point inside of a circle?
if x[i] * x[i] + y[i] * y[i] <= 1: success += 1 pi = 4 * success / tries return pi
</syntaxhighlight>
if x[i] * x[i] + y[i] * y[i] <= 1: success += 1 pi = 4 * success / tries return pi
</syntaxhighlight>