Skip to content
Prev Previous commit
Next Next commit
chore: use correct style
  • Loading branch information
piyushk77 committed Oct 10, 2023
commit 64d1afc58064a9d7e58b8f112559d351085ec51e
8 changes: 4 additions & 4 deletions Maths/RowEchelon.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const isMatrixValid = (matrix) => {
const checkNonZero = (currentRow, currentCol, matrix) => {
let numRows = matrix.length
for (let i = currentRow; i < numRows; i++) {
if (!isTolerant(0,matrix[i][currentCol], tolerance)) {
if (!isTolerant(0, matrix[i][currentCol], tolerance)) {
return true
}
}
Expand Down Expand Up @@ -91,8 +91,8 @@ const subtractRow = (currentRow, fromRow, matrix) => {
}

const isTolerant = (a, b, tolerance) => {
const absoluteDifference = Math.abs(a - b);
return (absoluteDifference <= tolerance);
const absoluteDifference = Math.abs(a - b)
return absoluteDifference <= tolerance
}

const rowEchelon = (matrix) => {
Expand All @@ -117,7 +117,7 @@ const rowEchelon = (matrix) => {
//..............make bottom elements zero...............
for (let x = i + 1; x < numRows; x++) {
factor = result[x][j]
if (isTolerant(0,factor,tolerance)) {
if (isTolerant(0, factor, tolerance)) {
continue
}
scalarMultiplication(i, factor, result)
Expand Down