From cbcf15e5ca7beade3365d1ca3d8a039702e1a5f4 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Fri, 1 Oct 2021 19:22:44 +0300 Subject: [PATCH] replaced addition to subtraction in a 2x2 matrix --- lesson_3/exercise_2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lesson_3/exercise_2.cpp b/lesson_3/exercise_2.cpp index 1962836..74ed2b6 100644 --- a/lesson_3/exercise_2.cpp +++ b/lesson_3/exercise_2.cpp @@ -98,7 +98,7 @@ double Matrix::calculateDeterminant(Matrix &arr) } else if (arr.size() == 2) { - determinant = arr[0][0] * arr[1][1] + arr[1][0] * arr[0][1]; + determinant = arr[0][0] * arr[1][1] - arr[1][0] * arr[0][1]; } else {