Menu

Exact-fraction Gauss-Jordan in JavaScript, with every row operation written out
📰

Exact-fraction Gauss-Jordan in JavaScript, with every row operation written out

DEV Community: typescript·David Hoot·about 8 hours ago
#KGi2Xccy
#devtotypescript#devto#dev#steps#rref
Long article (534 words) — no AI summary yet.
Reading 0:00
15s threshold

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 review). The result is a zero-dependency library that keeps every entry as an exact BigInt fraction, prints each row operation, and also does 2×2–4×4 cofactor determinants and 2×2/3×3 eigenvalues the same way.

The code is MIT-licensed at vaso81/matrix-rref-steps . It is not on the npm registry.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.