On Fri, Apr 17, 2009 at 03:14:20AM +0200, Gary Wright wrote:
>
> On Apr 16, 2009, at 12:29 PM, Shot (Piotr Szotkowski) wrote:
>>> I would have thought that z.eql?(nz) might be false. There doesn't
>>> seem to be a way to query a float to distinguish between -Infinity
>>> and Infinity
>>
>> These actually aren”Ēt ==, eql? nor equal?
>
> I wasn't very clear.  My point was that you have to do two tests to  
> determine if an arbitrary float is negative infinity or positive  
> infinity.
>
> def negative_infinity?(x)
>   !x.finite? and x < 0
> end
I can test normaly.
irb(main):019:0> x=1.0/0
=> Infinity
irb(main):020:0> y=-1.0/0
=> -Infinity
irb(main):021:0> x==y
=> false
-- 

The CPU has shifted, and become decentralized.