Recursive program to compute Taylor approx of cosine not functioning in Prolog
问题 I'm still pretty new to Prolog, and i'm not sure why this code isn't working. I believe it is most likely a problem with the base case or in the last 3 lines of the recursive case. Everything else works just fine. This program determines cosine calculated with series approximation, to do so it needs to calculate the factorial of 2K, also -1 ^ K, and then uses these 2 calculations in the final equation (this is done in % Recursive Case). % Factorial from class fact(0, 1). fact(N, F) :- N > 0,