I don't understand why the following code gives the wrong answer for Matrix 'u'. Matrix 'u' should equal the identity Matrix but only some of the values are correct. Can anyone help me understand why this might be happening?
for (k=0; k<3; k++) {
int j;
for (j=0; j<3; j++) {
int h;
for (h=0; h<3; h++) {
u[k][j]+=(F[k][h])*(B[h][j]);
}
}
}
Matrix F
2 -2.2 0.6
-0 0.4 -0.2
-3 3.2 -0.6
Matrix B
2 3 1
3 3 2
6 1 4
Matrix u
1 -4.44089e-16 0
0 1 0
8.88178e-16 1.33227e-15 1