I've a very basic issue.
import numpy as np
def u(x):
return 1 - x + x**2 - x**3 + x**4 - x**5 + x**6 - x**7 + x**8 - x**9 + x**10
X = np.array([8, 9])
Y = u(X)
print("u(8) = ", u(X)[0], "or", u(8))
print("u(9) = ", u(X)[1], "or", u(9))
I create an array containing 8 and 9, and then appy the function "u" to this array. But for some reason u(X)[1] != u(9) (even though X[1] == 9):
u(8) = 954437177 or 954437177
u(9) = -1156861335 or 3138105961
Weirdly enough, I don't have this problem for n < 9. What is wrong here? (and with me...)