ddunny / repo1

repo1
0 stars 0 forks source link

Raising a Numpy Array to a large power #5

Open ddunny opened 2 months ago

ddunny commented 2 months ago

I am using Numpy to raise a 2 X 2 array (matrix), with positive elements, to an integer power. To my surprise, starting at exponent 46, I am beginning to obtain negative elemnts in the result:

A = np.array([[1, 1], [1, 0]]) B = np.linalg.matrix_power(A, 46) print(B)

[[-1323752223 1836311903] [ 1836311903 1134903170]]

Things continue at powers higher than 46. WHAT AM I DOING WRONG? Thank you in advance for your help.

My expectation would be for the matrix elements to become larger and larger positive integers.