Re: [Wtr-general] OT: find min/max values in an array of floats

2007-05-08 Thread Bret Pettichord
Chris McMahon wrote: > I can think of a couple of ways to do this, but they're all painful in > one way or another. Ruby being Ruby, I wonder if there's some nifty > shortcut. Given > > floats = [] > floats << 3.456 > floats << 1.53 > floats << 5.123 > > show that the least element of the array i

Re: [Wtr-general] OT: find min/max values in an array of floats

2007-05-08 Thread Chris McMahon
Neat. I guess I should have just written the code and tried it out. On 5/8/07, Bret Pettichord <[EMAIL PROTECTED]> wrote: > Chris McMahon wrote: > > I can think of a couple of ways to do this, but they're all painful in > > one way or another. Ruby being Ruby, I wonder if there's some nifty > >

[Wtr-general] OT: find min/max values in an array of floats

2007-05-08 Thread Chris McMahon
I can think of a couple of ways to do this, but they're all painful in one way or another. Ruby being Ruby, I wonder if there's some nifty shortcut. Given floats = [] floats << 3.456 floats << 1.53 floats << 5.123 show that the least element of the array is 1.53 and the greatest element of the