From: "trans. (T. Onoma)" Date: 2004-10-05T04:00:11+09:00 Subject: Re: Too Many Ways? On Monday 04 October 2004 11:09 am, Brian Candler wrote: > I can't see what's hard about implementing them: have a couple of constant > objects for positive and negative infinity (like 'true' and 'false'). > > Then define -@ method so that -INF == NEGINF, and away you go. > > I'd be quite happy to have this just for ranges, although I expect everyone > would want them to integrate with numbers: 3 * INF == INF and so on. Will you give it a go? > Or can we use the Float 'Infinity' for this? Hmm... lets see... irb(main):018:0> i = 10.0/0 => Infinity irb(main):019:0> r = 0..i => 0..Infinity irb(main):020:0> r.member?(3) And she hangs :( I think it could work, but she needs some tuning. The idea that infinity is a Float is a bit odd too. Probably should be it's own class. Any one see otherwise? Also, has anyone already gone to the trouble of creating an Infinity class? T.