diff --git a/src/numerical/monte_carlo.py b/src/numerical/monte_carlo.py index 070ae2f..e62146e 100644 --- a/src/numerical/monte_carlo.py +++ b/src/numerical/monte_carlo.py @@ -9,7 +9,7 @@ def monte_carlo_pi(num_samples: int) -> float: x = random.uniform(-1, 1) y = random.uniform(-1, 1) - if x**2 + y**2 <= 1: + if x * x + y * y <= 1: inside_circle += 1 return 4 * inside_circle / num_samples