Posts by jfga • 21 points
1 post
-
2
votes1
answer668
viewsA: Approximation of the cosine function using the first n terms of a series
Your first problem is that when x = 0, soma = 1. Therefore, it should initialize sum with the value 1 and not 0. Next, you are using i to iterate from 0 to k however, within the placed loop k…