I can not understand why the function gives me an incorrect result 1,000,100,000.7423575, instead of the original result is supposed to be 1,000,000,000.75. Work has given them to us, we need to implement the feature of Python, higher-order functions and built my code so so. Just mention that in some parts of the code used other code here in the community. I would be happy if you could help me solve the problem.
thank you
def summ(a, b, f, nextt):
total = f(a) / 2.0
while a <= b:
total += f(a)
a = nextt(a)
total += f(b) / 2.0
return total
def Tr(fx, a, b, n):
h = float(b - a) / n
return summ(a, b, fx, lambda a:a + h)
print(Tr(lambda x:x**9, 0.0, 10.0, 100000))