Post Reply 
Summation based benchmark for calculators
09-06-2018, 10:23 PM
Post: #139
RE: Summation based benchmark for calculators
(09-06-2018 09:46 PM)Dave Britten Wrote:  
Code:
from math import *
def RunTest():
  x=0
  for i in range(1,100001):
    x=x+pow(exp(sin(atan(i))),1/3)
  print(x)

RunTest()

Hi, Dave Britten

Does Micro Python support default arguments, like regular Python ?

If Yes, changing def RunTest() to def RunTest(pow=pow, exp=exp, sin=sin, atan=atan) should be faster.
Now, all variables are locals (pow, exp, sin, atan are variables too)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Summation based benchmark for calculators - Albert Chan - 09-06-2018 10:23 PM



User(s) browsing this thread: 2 Guest(s)