I have a matrix
M = np.array([
[1, -2, -2, -2, 1, 2],
[0, 3, -2, -3, 1, 3],
[3, 0, 0, 1, -1, 2],
[3, -3, -2, 0, 1, 1],
[0, -3, 3, -3, -3, 2]
])
and I'm trying to replace the first row by itself modulo some number N = 2497969412496091.
I've been playing around with this in the IDE for a while, and even though
>>> M[0] % N
array([1, 2497969412496089, 2497969412496089, 2497969412496089, 1, 2], dtype=int64)
After I preform M[0] = M[0] % N and print the matrix M, I get
>>> M[0]
array([1, -746726695, -746726695, -746726695, 1, 2])
I've also tried to copy the intermediate step M[0] % N in a temporary variable and then setting it equal to M[0] but the problem still persists. What is going on here?