From: Ara.T.Howard@... Date: 2004-09-02T11:10:21+09:00 Subject: Re: invisible Infinity On Thu, 2 Sep 2004, Yukihiro Matsumoto wrote: > Hi, > > In message "invisible Infinity" > on 04/09/02, gabriele renzi writes: > > |Should we be able to access Infinity directly? It seem a strange > |unexplicable behaviour to me, that it exists but is not normally accessible. > > Considering non IEEE platform, there's no portable way to generate > Inifinity and NaN, I think. Teach me if I'm wrong. > > matz. is it an impossible idea to map the various Nan's to some singleton like InfinityClass - for which Infinity would be the only instance, similar to FalseClass and TrueClass? we could also have NegativeInfinity as well. operators for these singletons would be defined as class << Infinity def < other; false; end def > other; other == self ? false : true; end end class << NegativeInfinity def > other; false; end def < other; other == self ? false : true; end end the reason i say this is that the notion of infinity is useful for many things, like Time and Date, not just Numeric. perhaps this is too hard to make generic - but it would be a very useful paradigm to have at one's disposal. kind regards. -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; | and a weed grows, even though we do not love it. | --Dogen ===============================================================================