Worked example
a: 1 2 3 4
1 × 4 − 2 × 3 = 4 − 6 = −2
→ −2
Method and scope
Square matrices only. Gaussian elimination with partial pivoting uses cubic work rather than cofactor expansion. Every row swap flips the determinant sign. Floating-point cancellation near singularity can affect the answer.
det(A) = det(P) × ∏ Uᵢᵢ; det(P) ∈ {−1,+1}