diff --git a/matrix.ts b/matrix.ts index 4c2df49..0f6bcb5 100644 --- a/matrix.ts +++ b/matrix.ts @@ -29,7 +29,7 @@ export class Matrix { } add(other_matrix: Matrix) { - if(!(other_matrix.cols == this.cols && other_matrix.rows == this.cols)) throw Error("Other matrix has more or few rows or columns"); + if(!(other_matrix.cols == this.cols && other_matrix.rows == this.rows)) throw Error("Other matrix has more or few rows or columns"); for(let i=0; i