I have the following code which calculates Legende's polynomials.
The problem is that the function doesn't work when I input negative parameters. Is there something I'm missing?Code:((2*n-1)*x*leg(n-1, x) - (n-1)*leg(n-2, x))/n
EDIT: Okay, I'm an idiot. n is not supposed to be a negative.