Skip to content

Commit 855d20f

Browse files
committed
Use assertMatrixEquals(), otherwise there can be error due to floating point arithmetic errors
1 parent 1ff92f5 commit 855d20f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/test/java/com/thealgorithms/matrix/MatrixMultiplicationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void testMultiply2by2(){
1313
double[][] expected = {{19.0, 22.0}, {43.0, 50.0}};
1414

1515
double[][] result = MatrixMultiplication.multiply(matrixA, matrixB);
16-
assertMatrixEquals(expected, result);
16+
assertMatrixEquals(expected, result); // Because assertEquals can fails due to floating point precision issues, Therfore use assertMatrixEquals
1717
}
1818

1919
}

0 commit comments

Comments
 (0)