Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def trap_approx3(f,a,b,tol):
- i = 1 //counter
- last = 0
- nextLast = 0
- while ((last - nextLast) => tol):
- h = float(b-a)/i
- I = I + f(a + i*h)
- nextLast = last
- last = I*h
- return last
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement