Cramer's rule: Difference between revisions
→{{header|jq}}: fix bug
(→{{header|jq}}: fix bug) |
|||
Line 1,767:
| (a | det) as $ad
| if $ad == 0 then "matrix determinant is 0" | error
(reduce range(0; $n) as $r (a; .[$r][$c] = d[$r])) as $aa
| .[$c] = ($aa|det) / $ad )
end ;
def a: [
Line 1,786 ⟶ 1,787:
Solution is [2,-12,-4,1]
</pre>
=={{header|Julia}}==
{{works with|Julia|0.6}}
|