Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function riemann(func, first, last, rects, type)
- local size, sum = (last - first) / rects, 0
- for i = first, last, size do
- sum = sum + func(type == "left" and i - 1 or type == "right" and i or i - .5) * size
- end
- return sum
- end
Advertisement
Add Comment
Please, Sign In to add comment