From: Calamitas Date: 2008-12-24T01:37:31+09:00 Subject: [ruby-core:20836] Re: matrix.rb dyscalculic about determinants in 1.8.x On Tue, Dec 23, 2008 at 5:22 PM, Christian Neukirchen wrote: > Bug as of Ruby 1.6.x--1.8.x (has been fixed in trunk as of revision 5599 > without explicit mention as far as I can tell): > > Maxima 5.14.0 > (%i25) determinant(matrix([2,1],[1,-1])); > (%o25) - 3 > > Mathematica 6.0 > In[1]:= Det[{{2, 1}, {1, -1}}] > Out[1]= -3 > > Cramer's rule: > 2*(-1) - 1*1 = -3 > > But Ruby's matrix.rb says: > >>> Matrix[[2,1],[1,-1]].det > => -2 >> require 'matrix' => true >> Matrix[[2,1],[1,-1]].det => -2 >> require 'mathn' => true >> Matrix[[2,1],[1,-1]].det => -3 This is mentioned in the Pickaxe. This of course says nothing about why trunk returns the correct result. Peter