Skip to content

Commit a684355

Browse files
mrkwjcpavanky
authored andcommitted
Update monte_carlo_pi.py (arrayfire#108)
calc_pi_numpy returned integer value, it returns float now.
1 parent c9a8d7f commit a684355

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/benchmarks/monte_carlo_pi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def calc_pi_numpy(samples):
3838
np.random.seed(1)
3939
x = np.random.rand(samples).astype(np.float32)
4040
y = np.random.rand(samples).astype(np.float32)
41-
return 4 * np.sum(in_circle(x, y)) / samples
41+
return 4. * np.sum(in_circle(x, y)) / samples
4242

4343
def calc_pi_host(samples):
4444
count = sum(1 for k in frange(samples) if in_circle(random(), random()))

0 commit comments

Comments
 (0)