From: Run Paint Run Run Date: 2009-05-26T06:35:55+09:00 Subject: [ruby-core:23557] [Bug #1516] Matrix#determinant Documentation Error Bug #1516: Matrix#determinant Documentation Error http://redmine.ruby-lang.org/issues/show/1516 Author: Run Paint Run Run Status: Open, Priority: Normal ruby -v: ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] / ruby 1.9.0 (2008-06-20 revision 17482) [i486-linux] The rdoc for Matrix#determinant contains the following example on Ruby 1.8.7 (ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]): Matrix[[7,6], [3,9]].determinant => 63 This is indeed what that method returns, but is not the determinant of that matrix. The correct determinant is 45. There's presumably a reason why Matrix doesn't simply require 'mathn', with which this example works, but could this example either have 'require 'mathn'' prefixed, or be changed to one that works? (Better would be to backport the changes from 1.9, but I'm not sure how difficult this is). The rdoc for lib/matrix.rb has been updated in the trunk so this example appears as: Matrix[[7,6], [3,9]].determinant => 63.0 However, in 1.9.0 (ruby 1.9.0 (2008-06-20 revision 17482) [i486-linux]), at least, .determinant does return the correct answer: Matrix[[7,6], [3,9]].determinant => Rational(45, 1) So the trunk documentation can be updated to show the correct answer. ---------------------------------------- http://redmine.ruby-lang.org