Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def low_sum(n):
- result = 0
- for i in range(1, n + 1):
- if math.pi * i / n - math.pi / 2 == 0:
- result += 1
- else:
- result += math.sin(math.pi * i / n - math.pi / 2)/ (math.pi * i / n - math.pi / 2)
- return result
- def up_sum(n):
- result = 0
- for i in range(1, n + 1):
- if math.pi * (i - 1) / n - math.pi / 2 == 0:
- result += 1
- else:
- result += math.sin(math.pi * (i - 1) / n - math.pi / 2)/ (math.pi * (i - 1) / n - math.pi / 2)
- return result
- print(low_sum(10000))
- print(up_sum(10000))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement