{
  "id": 23654175,
  "title": "Exact-fraction Gauss-Jordan in JavaScript, with every row operation written out",
  "url": "https://urgent.news/2026/12/05/exact-fraction-gauss-jordan-in-javascript-with-every-row-operation",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-12-05T16:29:04.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/davidhoot/exact-fraction-gauss-jordan-in-javascript-with-every-row-operation-written-out-1lh5"
  },
  "original_language": null,
  "account": "The provided JavaScript library, matrix-rref-steps, offers an exact-fraction Gauss-Jordan elimination method that maintains every entry as an exact BigInt fraction throughout the process. This library prints each row operation step-by-step, allowing students to compare the exact arithmetic with their own manual calculations. The code is MIT-licensed and can be installed directly from GitHub without the need for an npm registry.\n\nThe library provides additional functionality, such as calculating 2×2–4×4 cofactor determinants and finding 2×2/3×3 eigenvalues using the characteristic polynomial. Rational roots for eigenvalues are identified exactly, while complex and irrational cases are handled using numeric values. The test suite validates the library's results against sympy.Matrix, confirming its accuracy in 39 instances.\n\nTo use this library, one can simply require 'matrix-rref-steps' and call the rrefWithSteps function, passing an array of arrays representing the augmented matrix. The library will return an object containing the reduced row echelon form (rref), the rank of the matrix, and an array of step-by-step operations performed during the elimination process.\n\nThe library accepts both decimal and fractional inputs, converting them to their exact fractional equivalents. This means that inputs like 0.75 or \"7/4\" are both valid and treated as 3/4. The determinantWithSteps function allows users to compute determinants using cofactor expansion along row 1, showing every minor in the process.\n\nEigenvalue calculations for 2×2 and 3×3 matrices are also provided, along with the characteristic polynomial. The library can find exact rational roots for eigenvalues and, if necessary, fall back to numeric values for complex or irrational cases.\n\nThe RREF calculator with row-operation steps, which utilizes this library, is available as a free online tool at RREF calculator with row-operation steps. No account is required to use the calculator. Two other MIT-licensed libraries, vaso81/ti84-stats-steps and vaso81/polynomial-factor-steps, complement this tool by offering additional functionalities, such as normalcdf/invNorm/binomial calculations for TI-84 calculators and polynomial factoring using the rational root theorem.",
  "summary": "Floating-point row reduction is a bad way to show students (or yourself) the Gauss-Jordan method. A pivot of 1/3 becomes 0.3333333333333333 , the next elimination step drifts, and the “step-by-step” write-up no longer matches the exact arithmetic you would do by hand. I needed the opposite of that for a math site I work on, MathAI GPT (I built it, so treat this as a maintainer’s write-up, not a…",
  "summary_source": "publisher",
  "key_points": [
    "JavaScript library matrix-rref-steps performs exact-fraction Gauss-Jordan elimination",
    "Library prints each row operation step-by-step for educational comparison",
    "MIT-licensed and available for direct GitHub installation"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "outlets_capped": false,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}