From: ara.t.howard@... Date: 2006-01-15T07:29:18+09:00 Subject: Re: Range#member? Oddity On Sun, 15 Jan 2006, David Vallner wrote: > You could theorethically check whether the range endpoints are comparable, > and whether the starting one defines #succ, and then mix in Enumerable to > the Ranges that indeed are to get more strictly correct behaviour. but that prevents me from doing this harp:~ > cat a.rb require "yaml" e = Float::EPSILON r = 1.0 .. 1.0000000000000091038288019262836314737796783447265625 class Float def succ() self + EPSILON end end a = r.to_a y "r.min" => ("%52.52f" % r.min) y "r.max" => ("%52.52f" % r.max) y "r.to_a.size" => r.to_a.size harp:~ > ruby a.rb --- r.min: "1.0000000000000000000000000000000000000000000000000000" --- r.max: "1.0000000000000091038288019262836314737796783447265625" --- r.to_a.size: 42 i can easily imagine uses for code just like that. i think it's best if ruby will let us run quickly with knives. regards. -a -- strong and healthy, who thinks of sickness until it strikes like lightning? preoccupied with the world, who thinks of death, until it arrives like thunder? -- milarepa