I need to create a cosine function that mimics the standard cos() function using McLauren's Series. I have already correctly implemented a sine function. The problem might be with the logic for the power and factorial in the for loop. For example, I used 82 degrees as the angle and the output was 0.570343. The correct output would be 0.139173
Might have to do with the way your fact method works. Note that factorial of 20 is already larger than what most integer types in c++ can represent accurately