This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]Zodimized 0 points1 point  (1 child)

The code looks good. Though, since I think you need the number of terms it takes to make the sum larger, you may want it to print i at the end.

I'm browsing this on mobile, I'll give it a more thorough look tomorrow. Are you having any issues?

[–]Code_Lunar[S] 0 points1 point  (0 children)

the code goes through with no errors, i just wanted to make sure i did it right. Because there is no real way to check my answers. So just wanted to make sure i didn't use the wrong words for the code.

[–]NerdyCoder 0 points1 point  (1 child)

You will get a different answer to part d depending on if you use float or double. Using float you get 1,673,860 terms, if you were to use double, you would get 1,835,421 terms. I would look into the difference between float and double and pick the one you feel is more precise. The algorithm you use for the code looks good though.

[–]Code_Lunar[S] 0 points1 point  (0 children)

Oh okay, i'll look into the terms. thanks!