[#9722] Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters — <noreply@...>

Bugs item #7278, was opened at 2006-12-14 13:59

8 messages 2006/12/14

[#9749] System V IPC in standard library? — Steven Jenkins <steven.jenkins@...>

Back in August, I needed a semaphore to serialize access to an external

14 messages 2006/12/19

[#9753] CVS freeze — SASADA Koichi <ko1@...>

Hi,

20 messages 2006/12/20
[#9755] Re: [ruby-dev:30039] CVS freeze — SASADA Koichi <ko1@...> 2006/12/20

Hi,

[#9757] Re: [ruby-dev:30040] Re: CVS freeze — SASADA Koichi <ko1@...> 2006/12/20

Hi,

Re: [ ruby-Bugs-7001 ] Determinant Problem in Matrix.rb

From: Nex3 <nex342@...>
Date: 2006-12-01 12:52:30 UTC
List: ruby-core #9646
URABE Shyouhei wrote:
> This is 100% intended.  You have to learn integer arithmetics when you
> want to use Integers instead of Floats.
>   
>> Matrix[[2, 1], [-1, 2]].determinant
>>
>> This gives 6, when the determinant is actually 5.  
>>     
>
> % ruby -rmatrix -e 'p Matrix[[2.0, 1.0], [-1.0, 2.0]].determinant'
> 5.0
Given that the typical way of calculating determinants involves no 
division at all, it seems odd that I would be required to use floats to 
get the correct result. In addition, the documentation of the Matrix 
class doesn't say that one should use floats... in fact, the example 
given for Matrix#determinant is done with integers.

That said, when looking at the documentation, I noticed that it said 
that "mathn" must be required in order for determinants to work 
properly. And this does work properly (with integers) after requiring 
mathn. Although it is rather unintuitive to do so.

In This Thread