Fixed broken add function lol

This commit is contained in:
Soikk
2022-08-31 20:48:37 +02:00
parent 33f4cdb84a
commit 76aff69027

View File

@ -54,11 +54,13 @@ matrix *fillMatrix(matrix *m, long double n){
}
matrix *addMatrix(matrix *m, long double n){
for(int i = 0; i < m->rows; ++i){
for(int j = 0; j < m->cols; ++j){
m->data[i][j] += n;
matrix *r = newMatrix(m->cols, m->rows);
for(int i = 0; i < r->rows; ++i){
for(int j = 0; j < r->cols; ++j){
r->data[i][j] = m->data[i][j] + n;
}
}
return r;
}
matrix *subtractMatrix(matrix *m, long double n){