gambas-source-code/benchmark/polynom.py
Benoît Minisini ebaf5d5ac8 [BENCHMARKS]
* NEW: Do less iterations in benchmarks to get the result faster.
* BUG: Fix 'sort.pl' bench.


git-svn-id: svn://localhost/gambas/trunk@7438 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-10-31 01:02:58 +00:00

23 lines
345 B
Python
Executable file

#!/usr/bin/python
n = 500000
x = 0.2
def t(x):
mu = 10.0
pu = 0.0
pol = [0] * 100
r = range(0,100)
for i in range(0,n):
for j in r:
pol[j] = mu = (mu + 2.0) / 2.0
su = 0.0
for j in r:
su = x * su + pol[j]
pu = pu + su
return pu
for i in range(2):
print t(x)