SonOfLilit
7/1/2007 11:55:00 AM
Have a look at matrix.rb (require matrix, ri Vector) and at the narray
gem (gem install narray, require 'narray', 'nmatrix', read the docs
that come with it for NVector).
The Vector and NVector datatypes seem to be fit for what you do, and
you can always .to_a them.
Aur
On 7/1/07, Robert Dober <robert.dober@gmail.com> wrote:
> On 7/1/07, baptiste Auguié <ba208@exeter.ac.uk> wrote:
> > yep, i do want (-2/3). Oh, i see, is 2/3 == 1 for Ruby?? OMG this is
> > mad !
> No 0 I am a declared egghead already, but it was the issue nonetheless.
>
> It is not mad for Computer Scientists only for real Scientists ;)
> You have heard the prime number joke before, have you not?
>
> Well here it goes spamming the group, but it *really* explains the
> problem of expectation and behavior:
>
> Theorem: All odd numbers are prime.
> Proof
> Theoretical Physician: 1 is odd but not prime, theorem fails!
> ***I spare you 42 disciplines here***
> Computer Scientist (that is me folks do not holler ;): 1 prime, 2
> prime, 3 prime Quod Erat Demonstrandum.
>
> Seriously now, in many fields 2/3 ==> 0 is much more useful than ==>
> 0.66666..., not in yours I guess. BTW Lua and Perl do it your way;
> Phyton does it our way.
>
> Cheers
> Robert
>
> --
> I always knew that one day Smalltalk would replace Java.
> I just didn't know it would be called Ruby
> -- Kent Beck
>
>